IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15931


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

added code for pmFPAGenerateReadout

Location:
trunk/psModules/src/camera
Files:
2 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
  • trunk/psModules/src/camera/pmFPAfileDefine.h

    r14889 r15931  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-09-19 21:37:58 $
     6 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-12-27 02:08:19 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    133133pmFPAfile *pmFPAfileDefineSingleFromArgs (bool *found, pmConfig *config, const char *filename,
    134134        const char *argname, int entry);
     135
     136// Select or construct the requested readout.  If the named entry does not exist, generate it based
     137// on the specified fpa and binning.  We have 4 possibilities: (INTERNAL or I/O file) and (exists or
     138// not).  This call is used after all user-requested pmFPAfiles have been generated.  A missing
     139// pmFPAfile is being used internally.
     140pmReadout *pmFPAGenerateReadout(const pmConfig *config, // configuration information
     141                                const pmFPAview *view, // select background for this entry
     142                                const char *name, // name of internal/external file
     143                                const pmFPA *fpa, // use this fpa to generate
     144                                const psImageBinning *binning);
     145
    135146/// @}
    136147# endif
Note: See TracChangeset for help on using the changeset viewer.