IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 26, 2007, 4:08:19 PM (18 years ago)
Author:
eugene
Message:

added code for pmFPAGenerateReadout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r15893 r15931  
    12191219}
    12201220
     1221// Select or construct the requested readout.  If the named entry does not exist, generate it based
     1222// on the specified fpa and binning.  We have 4 possibilities: (INTERNAL or I/O file) and (exists or
     1223// not).  This call is used after all user-requested pmFPAfiles have been generated.  A missing
     1224// pmFPAfile is being used internally.
     1225pmReadout *pmFPAGenerateReadout(const pmConfig *config, // configuration information
     1226                                const pmFPAview *view, // select background for this entry
     1227                                const char *name, // name of internal/external file
     1228                                const pmFPA *fpa, // use this fpa to generate
     1229                                const psImageBinning *binning) {
     1230  pmReadout *readout = NULL;
     1231
     1232  bool status = true;
     1233  pmFPAfile *file = psMetadataLookupPtr(&status, config->files, name);
     1234
     1235  // if the file does not exist, it is not being used as an I/O file: define an internal version
     1236  if (file == NULL) {
     1237    readout = pmFPAfileDefineInternal (config->files, name, binning->nXruff, binning->nYruff, PS_TYPE_F32);
     1238    return readout;
     1239  }
     1240
     1241  // if the mode is INTERNAL, it has been defined in a previous call.  XXX This seems to require
     1242  // that the readout have the same dimensions for all entries.
     1243  if (file->mode == PM_FPA_MODE_INTERNAL) {
     1244    readout = file->readout;
     1245    return readout;
     1246  }
     1247
     1248  // we are using this pmFPAfile as an I/O file: select readout or create
     1249  readout = pmFPAviewThisReadout (view, file->fpa);
     1250  if (readout == NULL) {
     1251    // readout does not yet exist: create from input
     1252    // XXX we have an inconsistency in this calculation here and in pmFPACopy
     1253    // XXX use the psImageBinning functions to set the output image size
     1254    pmFPAfileCopyStructureView (file->fpa, fpa, binning->nXbin, binning->nYbin, view);
     1255    readout = pmFPAviewThisReadout (view, file->fpa);
     1256    PS_ASSERT (binning->nXruff == readout->image->numCols, false);
     1257    PS_ASSERT (binning->nYruff == readout->image->numRows, false);
     1258  }
     1259
     1260  return readout;
     1261}
     1262
Note: See TracChangeset for help on using the changeset viewer.