Changeset 42186 for branches/eam_branches/ipp-20220316
- Timestamp:
- Apr 30, 2022, 4:30:17 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20220316/fpcamera/src
- Files:
-
- 5 edited
-
fpcameraAnalysis.c (modified) (4 diffs)
-
fpcameraArguments.c (modified) (2 diffs)
-
fpcameraChooseRefstars.c (modified) (1 diff)
-
fpcameraCleanup.c (modified) (2 diffs)
-
fpcameraParseCamera.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraAnalysis.c
r42183 r42186 20 20 21 21 // loop over the input images 22 pmFPAfile *input = psMetadataLookupPtr ( NULL, config->files, "FPCAMERA.INPUT");22 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "FPCAMERA.INPUT"); 23 23 if (!input) ESCAPE(FPCAMERA_ERR_CONFIG, "Can't find or interpret output file rule FPCAMERA.INPUT!"); 24 24 25 25 // astrometry reference (smf) 26 pmFPAfile *astrom = psMetadataLookupPtr ( NULL, config->files, "FPCAMERA.INPUT.ASTROM");26 pmFPAfile *astrom = psMetadataLookupPtr (&status, config->files, "FPCAMERA.INPUT.ASTROM"); 27 27 if (!astrom) ESCAPE(FPCAMERA_ERR_CONFIG, "Can't find or interpret output file rule FPCAMERA.INPUT.ASTROM!"); 28 28 … … 33 33 pmFPAfileActivate (config->files, true, "FPCAMERA.INPUT.VARIANCE"); 34 34 pmFPAfileActivate (config->files, true, "FPCAMERA.RESID"); 35 // Note FPCAMERA.RESID is tied to FPCAMERA.INPUT so they must be active in the same block. 35 pmFPAfileActivate (config->files, true, "PSPHOT.PSF.LOAD"); // if this file is defined, we need to activate it now 36 // Note: the output file FPCAMERA.RESID is tied to FPCAMERA.INPUT so they must be active in the same block. 36 37 37 38 view = pmFPAviewAlloc (0); … … 57 58 58 59 fpcameraChooseRefstars (input, astrom, view); 60 61 // Provide a simple (wrong) PSF as a default if psf model is not supplied with -psf or -psflist. 62 // The user-supplied psf model will replace this one on a chip-by-chip basis 63 // pmPSF *psf = pmPSFBuildSimple ("PS_MODEL_PS1_V1", 5.0, 5.0, 0.0, 0.5); 64 pmPSF *psf = pmPSFBuildSimple ("PS_MODEL_GAUSS", 5.0, 5.0, 0.0); 65 psf->fieldNx = readout->image->numCols; 66 psf->fieldNy = readout->image->numRows; 67 psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot PSF model", psf); 68 psFree (psf); 69 70 if (!psphotForcedReadout (config, view, "FPCAMERA.INPUT")) ESCAPE(FPCAMERA_ERR_DATA, "failure in psphotForcedReadout"); 59 71 } 72 // drop all versions of the internal files 73 status = true; 74 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL"); 75 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV"); 76 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 77 if (!status) ESCAPE(FPCAMERA_ERR_PROG, "trouble dropping internal files"); 60 78 } 61 79 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE(FPCAMERA_ERR_IO, "failure in IOChecks(AFTER) at Chip"); … … 72 90 // chip->process is set (unset) based on command-line -chip selections (in fpcameraArguments) 73 91 // chip->file_exists is set (in pmFPAFlags.c:pmChipSetFileStatus) by pmFPAfileDefineFromArgs (in pmFPAAddSource...) 92 93 /* 94 // XXX set sxx, etc from FWHM in recipe 95 pmPSF *psf = pmPSFBuildSimple (modelNames->data[0], 1.0, 1.0, 0.0, 1.0); 96 psf->fieldNx = readout->image->numCols; 97 psf->fieldNy = readout->image->numRows; 98 psFree (modelNames); 99 100 */ -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraArguments.c
r42183 r42186 11 11 fpcameraErrorRegister(); // register our error codes/messages 12 12 pmModelClassInit(); // model inits are needed in pmSourceIO 13 psphotInit(); 13 14 14 15 if (argc == 1) ESCAPE(FPCAMERA_ERR_ARGUMENTS, "No arguments supplied"); … … 72 73 if (!status) ESCAPE(FPCAMERA_ERR_ARGUMENTS, "Missing -astrom-file (input) : provide an smf or similar"); 73 74 75 // specify the input images to process 76 status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT.PSF", "-psf", "-psflist"); 77 // user-supplied psf model is optional 78 74 79 if (argc != 2) ESCAPE(FPCAMERA_ERR_ARGUMENTS, "Incorrect number of arguments supplied"); 75 80 -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraChooseRefstars.c
r42183 r42186 105 105 pmDetections *detections = pmDetectionsAlloc(); 106 106 detections->allSources = psArrayAllocEmpty (100); 107 detections->newSources = psArrayAllocEmpty (100); 107 108 108 109 bool status = psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot detections", detections); -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraCleanup.c
r42178 r42186 3 3 /* \brief this loop saves the photometry/astrometry data files */ 4 4 void fpcameraCleanup (pmConfig *config, psMetadata *stats) { 5 6 psMemCheckCorruption (stderr, true); 5 7 6 8 psFree (stats); … … 10 12 11 13 psTimerStop (); 12 psMemCheckCorruption (stderr, true); 14 psphotVisualClose(); 15 13 16 pmModelClassCleanup (); 14 17 psTimeFinalize (); 15 18 pmConceptsDone (); 16 19 pmConfigDone (); 20 21 pmSourceFitSetDone (); 22 psLibFinalize(); 23 17 24 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "fpcamera"); 18 25 return; -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraParseCamera.c
r42183 r42186 19 19 if (!status) ESCAPE (PS_ERR_UNKNOWN, "failed to load find definition"); 20 20 21 pmFPAfile *psphotInput = pmFPAfileDefineFromFile (config, input, 1, 1, "PSPHOT.INPUT"); 22 if (!psphotInput) ESCAPE(FPCAMERA_ERR_CONFIG, "Failed to define FPA for PSPHOT.INPUT"); 23 21 24 if (!psphotSetMaskBits (config)) ESCAPE (PS_ERR_UNKNOWN, "failed to set mask bit values"); 22 25 … … 24 27 pmFPAfileDefineFromArgs (&status, config, "FPCAMERA.INPUT.ASTROM", "INPUT.ASTROM"); 25 28 if (!status) ESCAPE(FPCAMERA_ERR_CONFIG, "Failed to build FPA from FPCAMERA.INPUT.ASTROM"); 29 30 // if optional PSF model is supplied, associate with input file 31 if (psMetadataLookupPtr(NULL, config->arguments, "INPUT.PSF")) { 32 pmFPAfileBindFromArgs(&status, input, config, "PSPHOT.PSF.LOAD", "INPUT.PSF"); 33 if (!status) ESCAPE(FPCAMERA_ERR_CONFIG, "Failed to find/build PSPHOT.PSF.LOAD"); 34 } 26 35 27 36 // select the current recipe … … 56 65 return true; 57 66 } 67
Note:
See TracChangeset
for help on using the changeset viewer.
