IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2011, 1:05:28 PM (15 years ago)
Author:
watersc1
Message:

Merge of trunk back into branch.

Location:
branches/czw_branch/20101203
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/ppSim/src/ppSimCreate.c

    r29125 r30631  
    103103        psMetadataAddF32(recipe, PS_LIST_TAIL, "SEEING", PS_META_REPLACE, "Seeing SIGMA (pixels)", seeing / 2.0 / sqrt(2.0 * log(2.0)) / scale);
    104104
     105        float seeingMax = psMetadataLookupF32(&status, recipe, "SEEING.MAX");
     106        psMetadataAddF32(recipe, PS_LIST_TAIL, "SEEING.MAX", PS_META_REPLACE, "Seeing SIGMA (pixels)", seeingMax / 2.0 / sqrt(2.0 * log(2.0)) / scale);
     107
    105108        // if we have been supplied an input image, but no ra & dec, use the input image values
    106109        if (input) {
     
    132135    bool doPhotom = psMetadataLookupBool(&status, recipe, "PHOTOM"); // Density of fakes
    133136    if (doPhotom) {
    134 
    135         // XXX at the moment, we can perform photometry on the fake sources and the forced
    136         // photometry positions, but not one or the other.  Also, we only support photometry in
    137         // the context of an image previously analysed by psphot.  Add support for:
    138         // * photometry of a pure fake image (requires peak detection and psf creation)
    139         // * photometry of forced source positions without fake image (this might work, it just
    140         // requires not generating any fake features).
    141 
    142         if (!input) {
    143             psError(PS_ERR_UNKNOWN, false, "input image not found; currently required for photometry");
    144             return NULL;
    145         }
    146 
    147         // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?)
    148         pmFPAfile *fakeImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSIM.FAKE.CHIP");
    149         if (!fakeImage) {
    150             psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FAKE.CHIP"));
    151             psFree(fpa);
    152             return NULL;
    153         }
    154         if (fakeImage->type != PM_FPA_FILE_IMAGE) {
    155             psError(PS_ERR_IO, true, "PPSIM.FAKE.CHIP is not of type IMAGE");
    156             psFree(fpa);
    157             return NULL;
    158         }
    159 
    160         // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?)
    161         pmFPAfile *forceImage = NULL;
    162         if (input) {
    163             forceImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSIM.FORCE.CHIP");
    164             if (!forceImage) {
    165                 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FORCE.CHIP"));
    166                 psFree(fpa);
    167                 return NULL;
    168             }
    169             if (forceImage->type != PM_FPA_FILE_IMAGE) {
    170                 psError(PS_ERR_IO, true, "PPSIM.FORCE.CHIP is not of type IMAGE");
    171                 psFree(fpa);
    172                 return NULL;
    173             }
    174         }
    175 
    176         // define associated psphot input/output files
    177         if (!ppSimPhotomFiles (config, fakeImage, forceImage)) {
    178             psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot");
    179             psFree(fpa);
    180             return NULL;
    181         }
    182     } else {
    183         // have we supplied a psf model?  this happens in ppSimPhotomFiles if we request a photometry
    184         // analysis.  however, even if we do not, a psf model may be used to generate the fake
    185         // sources.
    186         if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {
    187             // tie the psf file to the chipMosaic
    188             pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
    189             if (!status) {
    190                 psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD");
    191                 psFree(fpa);
    192                 return NULL;
    193             }
    194         }
     137        psError(PS_ERR_UNKNOWN, false, "in-line photometry in ppSim had been deprecated");
     138        return NULL;
     139    }
     140
     141    // have we supplied a psf model?  this happens in ppSimPhotomFiles if we request a photometry
     142    // analysis.  however, even if we do not, a psf model may be used to generate the fake
     143    // sources.
     144    if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {
     145        // tie the psf file to the chipMosaic
     146        pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
     147        if (!status) {
     148            psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD");
     149            psFree(fpa);
     150            return NULL;
     151        }
    195152    }
    196153
     
    257214                }
    258215            }
     216            // XXX this is a hack, but I don't have a better way at the moment: assumes a single cell per chip
     217            if (nx) {
     218                psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.XSIZE", PS_META_REPLACE, "", nx);
     219            } else {
     220                nx = psMetadataLookupF32(&status, cell->concepts, "CELL.XSIZE");
     221                psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.XSIZE", PS_META_REPLACE, "", nx);
     222            }
     223            if (ny) {
     224                psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.YSIZE", PS_META_REPLACE, "", ny);
     225            } else {
     226                ny = psMetadataLookupF32(&status, cell->concepts, "CELL.YSIZE");
     227                psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.YSIZE", PS_META_REPLACE, "", ny);
     228            }
    259229        }
    260230    }
Note: See TracChangeset for help on using the changeset viewer.