IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 30, 2022, 4:30:17 PM (4 years ago)
Author:
eugene
Message:

added -psf option; fpcamera seems to work quite well now if supplied the psf file measured for the chip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraAnalysis.c

    r42183 r42186  
    2020
    2121    // loop over the input images
    22     pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "FPCAMERA.INPUT");
     22    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "FPCAMERA.INPUT");
    2323    if (!input) ESCAPE(FPCAMERA_ERR_CONFIG, "Can't find or interpret output file rule FPCAMERA.INPUT!");
    2424
    2525    // astrometry reference (smf)
    26     pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "FPCAMERA.INPUT.ASTROM");
     26    pmFPAfile *astrom = psMetadataLookupPtr (&status, config->files, "FPCAMERA.INPUT.ASTROM");
    2727    if (!astrom) ESCAPE(FPCAMERA_ERR_CONFIG, "Can't find or interpret output file rule FPCAMERA.INPUT.ASTROM!");
    2828
     
    3333    pmFPAfileActivate (config->files, true, "FPCAMERA.INPUT.VARIANCE");
    3434    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.
    3637
    3738    view = pmFPAviewAlloc (0);
     
    5758
    5859                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");
    5971            }
     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");
    6078        }
    6179        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE(FPCAMERA_ERR_IO, "failure in IOChecks(AFTER) at Chip");
     
    7290// chip->process is set (unset) based on command-line -chip selections (in fpcameraArguments)
    7391// 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*/
Note: See TracChangeset for help on using the changeset viewer.