Changeset 14212
- Timestamp:
- Jul 13, 2007, 5:42:11 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
psastro/src/psastroDefineFiles.c (modified) (1 diff)
-
psphot/src/psphotDefineFiles.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroDefineFiles.c
r12806 r14212 4 4 5 5 // these calls bind the I/O handle to the specified fpa 6 if (!pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT")) { 6 pmFPAfile *output = NULL; 7 8 output = pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT"); 9 if (!output) { 7 10 psError(PSASTRO_ERR_CONFIG, false, "Failed to build FPA from PSASTRO.INPUT"); 8 11 return false; 9 12 } 13 output->save = true; 10 14 11 15 # if (0) -
trunk/psphot/src/psphotDefineFiles.c
r13528 r14212 16 16 17 17 // the output sources are carried on the input->fpa structures 18 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT")) { 18 pmFPAfile *outsources = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT"); 19 if (!outsources) { 19 20 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT"); 20 21 return false; 21 22 } 23 outsources->save = true; 22 24 23 25 // if we are choosing not to save the output detections, mark this file inactive so it will … … 25 27 if (!psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) { 26 28 pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT"); 29 outsources->save = false; 27 30 } 28 31 29 32 // optionally save the residual image 30 33 if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) { 31 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) { 34 pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID"); 35 if (!output) { 32 36 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID"); 33 37 return false; 34 38 } 39 output->save = true; 35 40 } 36 41 // optionally save the background model (small FITS image) … … 38 43 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 39 44 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 40 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) { 45 pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL"); 46 if (!output) { 41 47 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL"); 42 48 return false; 43 49 } 50 output->save = true; 44 51 } 45 52 // optionally save the background model's standard deviation (small FITS image) … … 47 54 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 48 55 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 49 if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) { 56 pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV"); 57 if (!output) { 50 58 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV"); 51 59 return false; 52 60 } 61 output->save = true; 53 62 } 54 63 // optionally save the full background image 55 64 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) { 56 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND")) { 65 pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKGND"); 66 if (!output) { 57 67 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND"); 58 68 return false; 59 69 } 70 output->save = true; 60 71 } 61 72 // optionally save the background-subtracted image 62 73 if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) { 63 if (!pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB")) { 74 pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, 1, 1, "PSPHOT.BACKSUB"); 75 if (!output) { 64 76 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT."); 65 77 return false; 66 78 } 79 output->save = true; 67 80 } 68 81 // optionally save the PSF Model 69 82 if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) { 70 if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) { 83 pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE"); 84 if (!output) { 71 85 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE"); 72 86 return false; 73 87 } 88 output->save = true; 74 89 } 75 90 … … 77 92 // allow specific plots only 78 93 if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) { 79 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) { 94 pmFPAfile *output = NULL; 95 output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS"); 96 if (!output) { 80 97 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.MOMENTS"); 81 98 return false; 82 99 } 83 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) { 100 output->save = true; 101 output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL"); 102 if (!output) { 84 103 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.PSFMODEL"); 85 104 return false; 86 105 } 87 if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) { 106 output->save = true; 107 output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID"); 108 if (!output) { 88 109 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.APRESID"); 89 110 return false; 90 111 } 112 output->save = true; 91 113 } 92 114
Note:
See TracChangeset
for help on using the changeset viewer.
