Changeset 12505 for trunk/pswarp/src/pswarpDataLoad.c
- Timestamp:
- Mar 19, 2007, 3:58:02 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpDataLoad.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpDataLoad.c
r10958 r12505 9 9 bool pswarpDataLoad (pmConfig *config) { 10 10 11 bool status; 11 12 pmChip *chip; 12 13 pmCell *cell; 13 14 pmReadout *readout; 14 15 pmFPAview *view; 16 17 // select the current recipe 18 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE); 19 if (!recipe) { 20 psError(PSWARP_ERR_CONFIG, false, "Can't find PSASTRO recipe needed for pixel scale!\n"); 21 return false; 22 } 23 24 // physical pixel scale in microns per pixel 25 double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE"); 26 if (!status) { 27 psError(PS_ERR_IO, false, "Failed to lookup pixel scale"); 28 return false; 29 } 15 30 16 31 // select the input data sources … … 21 36 } 22 37 38 // use the external astrometry source if supplied 39 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM"); 40 if (!astrom) { 41 fprintf (stderr, "*** using header astrometry\n"); 42 astrom = input; 43 } 44 23 45 // select the output readout 24 46 view = pmFPAviewAlloc (0); … … 44 66 // XXX need to optionally load the astrometry datafile 45 67 bool bilevelAstrometry = false; 46 pmHDU *phu = pmFPAviewThisPHU (view, input->fpa);68 pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa); 47 69 if (phu) { 48 70 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1"); … … 52 74 } 53 75 if (bilevelAstrometry) { 54 pmAstromReadBilevelMosaic (input->fpa, phu->header );76 pmAstromReadBilevelMosaic (input->fpa, phu->header, pixelScale); 55 77 } 56 78 … … 64 86 65 87 // read WCS data from the corresponding header 66 pmHDU *hdu = pmFPAviewThisHDU (view, input->fpa);88 pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa); 67 89 if (bilevelAstrometry) { 68 90 pmAstromReadBilevelChip (chip, hdu->header); 69 91 } else { 70 // XXX get pixelScale from recipes. does it matter?71 float pixelScale = 13.5;72 92 pmAstromReadWCS (input->fpa, chip, hdu->header, pixelScale); 73 93 }
Note:
See TracChangeset
for help on using the changeset viewer.
