Changeset 13109
- Timestamp:
- May 1, 2007, 12:22:03 PM (19 years ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 3 edited
-
pswarpDataLoad.c (modified) (2 diffs)
-
pswarpDefine.c (modified) (1 diff)
-
pswarpHeadersLoad.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpDataLoad.c
r12771 r13109 60 60 } 61 61 if (bilevelAstrometry) { 62 pmAstromReadBilevelMosaic (input->fpa, phu->header); 62 if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) { 63 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA."); 64 psFree(view); 65 return false; 66 } 63 67 } 64 68 … … 74 78 pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa); 75 79 if (bilevelAstrometry) { 76 pmAstromReadBilevelChip (chip, hdu->header); 80 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 81 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input FPA."); 82 psFree(view); 83 return false; 84 } 77 85 } else { 78 86 // we use a default FPA pixel scale of 1.0 79 pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0); 87 if (!pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0)) { 88 psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input FPA."); 89 psFree(view); 90 return false; 91 } 80 92 } 81 93 -
trunk/pswarp/src/pswarpDefine.c
r12826 r13109 65 65 } 66 66 if (bilevelAstrometry) { 67 pmAstromReadBilevelMosaic (skycell->fpa, phu->header); 68 pmAstromReadBilevelChip (chip, hdu->header); 67 if (!pmAstromReadBilevelMosaic (skycell->fpa, phu->header)) { 68 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for skycell."); 69 psFree(view); 70 return false; 71 } 72 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 73 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for skycell."); 74 psFree(view); 75 return false; 76 } 69 77 } else { 70 78 // we use a default FPA pixel scale of 1.0 71 pmAstromReadWCS (skycell->fpa, chip, hdu->header, 1.0); 79 if (!pmAstromReadWCS (skycell->fpa, chip, hdu->header, 1.0)) { 80 psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for skycell."); 81 psFree(view); 82 return false; 83 } 72 84 } 73 85 -
trunk/pswarp/src/pswarpHeadersLoad.c
r12528 r13109 2 2 3 3 // XXX this function should load all of the PSWARP.INPUT headers 4 // it should examine the overlap between each chip in PSWARP.INPUT 4 // it should examine the overlap between each chip in PSWARP.INPUT 5 5 // and the output (pswarpMatchRange) and select/de-select the chips 6 // and/or cell which contribute pixels. 6 // and/or cell which contribute pixels. 7 7 8 8 // pswarpDataLoad should then load the pixel of the needed chips … … 19 19 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSWARP.INPUT"); 20 20 if (!input) { 21 psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");22 return false;21 psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n"); 22 return false; 23 23 } 24 24 … … 26 26 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM"); 27 27 if (!astrom) { 28 astrom = input;28 astrom = input; 29 29 } 30 30 31 31 // select the output readout 32 32 view = pmFPAviewAlloc (0); … … 36 36 pmReadout *output = pmFPAfileThisReadout (config->files, view, "PSWARP.OUTPUT"); 37 37 if (!output) { 38 psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");39 return false;38 psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n"); 39 return false; 40 40 } 41 41 psFree (view); 42 42 43 43 // de-activate PSWARP.SKYCELL and PSWARP.OUTPUT 44 pmFPAfileActivate (config->files, false, "PSWARP.SKYCELL");45 pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT");44 pmFPAfileActivate(config->files, false, "PSWARP.SKYCELL"); 45 pmFPAfileActivate(config->files, false, "PSWARP.OUTPUT"); 46 46 47 47 view = pmFPAviewAlloc (0); … … 52 52 // find the FPA phu 53 53 bool bilevelAstrometry = false; 54 pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa);54 pmHDU *phu = pmFPAviewThisPHU(view, astrom->fpa); 55 55 if (phu) { 56 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");57 if (ctype) {58 bilevelAstrometry = !strcmp(&ctype[4], "-DIS");59 }56 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1"); 57 if (ctype) { 58 bilevelAstrometry = !strcmp(&ctype[4], "-DIS"); 59 } 60 60 } 61 61 if (bilevelAstrometry) { 62 pmAstromReadBilevelMosaic (input->fpa, phu->header); 63 } 62 if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) { 63 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input."); 64 psFree(view); 65 return false; 66 } 67 } 64 68 65 69 // files associated with the science image … … 69 73 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 70 74 if (!chip->process || !chip->file_exists) { continue; } 71 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);75 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 72 76 73 77 // read WCS data from the corresponding header 74 pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa); 75 if (bilevelAstrometry) { 76 pmAstromReadBilevelChip (chip, hdu->header); 77 } else { 78 // we use a default FPA pixel scale of 1.0 79 pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0); 80 } 78 pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa); 79 if (bilevelAstrometry) { 80 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 81 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input."); 82 psFree(view); 83 return false; 84 } 85 } else { 86 // we use a default FPA pixel scale of 1.0 87 if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) { 88 psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input."); 89 psFree(view); 90 return false; 91 } 92 } 81 93 82 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {94 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 83 95 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 84 96 if (!cell->process || !cell->file_exists) { continue; } 85 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);97 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 86 98 87 // process each of the readouts88 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {89 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);90 if (! readout->data_exists) { continue; }99 // process each of the readouts 100 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 101 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 102 if (! readout->data_exists) { continue; } 91 103 92 // XXX Replace with a function to examine the overlap and turn on/off chips 93 // based on that result94 // pswarpTransformReadout_Opt (output, readout, config);104 // XXX Replace with a function to examine the overlap and turn on/off chips 105 // based on that result 106 // pswarpTransformReadout_Opt (output, readout, config); 95 107 96 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);97 }98 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);99 }100 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);108 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 109 } 110 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 111 } 112 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 101 113 } 102 114 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
Note:
See TracChangeset
for help on using the changeset viewer.
