Changeset 12771 for trunk/pswarp/src/pswarpDataLoad.c
- Timestamp:
- Apr 5, 2007, 5:38:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpDataLoad.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpDataLoad.c
r12526 r12771 17 17 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSWARP.INPUT"); 18 18 if (!input) { 19 psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");20 return false;19 psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n"); 20 return false; 21 21 } 22 22 … … 24 24 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM"); 25 25 if (!astrom) { 26 astrom = input;26 astrom = input; 27 27 } 28 28 29 29 // select the output readout 30 30 view = pmFPAviewAlloc (0); … … 34 34 pmReadout *output = pmFPAfileThisReadout (config->files, view, "PSWARP.OUTPUT"); 35 35 if (!output) { 36 psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");37 return false;36 psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n"); 37 return false; 38 38 } 39 39 psFree (view); … … 42 42 pmFPAfileActivate (config->files, false, "PSWARP.SKYCELL"); 43 43 pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT"); 44 pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.MASK"); 45 pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.WEIGHT"); 44 46 45 47 view = pmFPAviewAlloc (0); … … 52 54 pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa); 53 55 if (phu) { 54 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");55 if (ctype) {56 bilevelAstrometry = !strcmp (&ctype[4], "-DIS");57 }56 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1"); 57 if (ctype) { 58 bilevelAstrometry = !strcmp (&ctype[4], "-DIS"); 59 } 58 60 } 59 61 if (bilevelAstrometry) { 60 pmAstromReadBilevelMosaic (input->fpa, phu->header);61 } 62 pmAstromReadBilevelMosaic (input->fpa, phu->header); 63 } 62 64 63 65 // files associated with the science image … … 67 69 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 68 70 if (!chip->process || !chip->file_exists) { continue; } 69 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);71 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 70 72 71 73 // read WCS data from the corresponding header 72 pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);73 if (bilevelAstrometry) {74 pmAstromReadBilevelChip (chip, hdu->header); 75 } else {76 // we use a default FPA pixel scale of 1.077 pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0);78 }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 } 79 81 80 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {82 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 81 83 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 82 84 if (!cell->process || !cell->file_exists) { continue; } 83 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);85 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 84 86 85 // process each of the readouts86 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {87 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);88 if (! readout->data_exists) { continue; }87 // process each of the readouts 88 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 89 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 90 if (! readout->data_exists) { continue; } 89 91 90 // XXX _Opt version uses locally-linear map91 // pswarpTransformReadout (output, readout, config);92 pswarpTransformReadout_Opt (output, readout, config);92 // XXX _Opt version uses locally-linear map 93 // pswarpTransformReadout (output, readout, config); 94 pswarpTransformReadout_Opt (output, readout, config); 93 95 94 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);95 }96 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);97 }98 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);96 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 97 } 98 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 99 } 100 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 99 101 } 100 102 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
Note:
See TracChangeset
for help on using the changeset viewer.
