Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

pmFPAfile.h

Go to the documentation of this file.
00001 /** @file  pmFPAview.h
00002 *
00003 *  @brief Tools to manipulate the FPA structure elements.
00004 *
00005 *  @ingroup AstroImage
00006 *
00007 *  @author EAM, IfA
00008 *
00009 *  @version $Revision: 1.5 $ $Name: rel12 $
00010 *  @date $Date: 2006/06/28 19:22:11 $
00011 *
00012 *  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
00013 */
00014 
00015 #ifndef PM_FPA_FILE_H
00016 #define PM_FPA_FILE_H
00017 
00018 #include "pslib.h"
00019 #include "pmConfig.h"
00020 #include "pmFPA.h"
00021 #include "pmFPAview.h"
00022 
00023 typedef enum {
00024     PM_FPA_BEFORE,
00025     PM_FPA_AFTER,
00026 } pmFPAfilePlace;
00027 
00028 typedef enum {
00029     PM_FPA_FILE_NONE,
00030     PM_FPA_FILE_SX,
00031     PM_FPA_FILE_OBJ,
00032     PM_FPA_FILE_CMP,
00033     PM_FPA_FILE_CMF,
00034     PM_FPA_FILE_RAW,
00035     PM_FPA_FILE_IMAGE,
00036     PM_FPA_FILE_PSF,
00037     PM_FPA_FILE_JPEG,
00038 } pmFPAfileType;
00039 
00040 typedef enum {
00041     PM_FPA_MODE_NONE,
00042     PM_FPA_MODE_READ,
00043     PM_FPA_MODE_WRITE,
00044     PM_FPA_MODE_INTERNAL,
00045     PM_FPA_MODE_REFERENCE,
00046 } pmFPAfileMode;
00047 
00048 typedef enum {
00049     PM_FPA_STATE_OPEN     = 0x01,
00050     PM_FPA_STATE_CLOSED   = 0x02,
00051     PM_FPA_STATE_INACTIVE = 0x04,
00052 } pmFPAfileState;
00053 
00054 typedef struct
00055 {
00056     pmFPAfileMode mode;   // is this file read, written, or only used internally?
00057     pmFPAfileType type;   // what type of data is read from / written to disk?
00058     pmFPAfileState state;  // have we opened the file, etc?
00059 
00060     pmFPALevel fileLevel;  // what level in the FPA hierarchy represents a unique file?
00061     pmFPALevel dataLevel;  // at what level do we read/write the data segment?
00062     pmFPALevel freeLevel;  // at what level do we read/write the data segment?
00063 
00064     pmFPA *fpa;    // for I/O files, we carry a pointer to the complete fpa
00065     psFits *fits;   // for I/O files of fits type (IMAGE, CMP, CMF), we carry a file handle
00066 
00067     psMetadata *phu;   // pointer (view) to the current phu header
00068     psMetadata *header;   // pointer (view) to the current hdu header
00069 
00070     pmReadout *readout;   // for internal files, we only carry a single readout
00071 
00072     psMetadata *names;   // filenames supplied by the cmdline or detdb are saved here
00073 
00074     char *filerule;   // rule for constructing a filename when needed
00075     char *filextra;   // additional information used to define filenames (context dependent)
00076     char *extrule;   // rule for constructing an extension name when needed
00077     char *extxtra;   // additional information used to define extension names (context dependent)
00078 
00079     char *name;    // the name of the rule (useful for debugging / tracing)
00080     char *filename;   // the current name of an active file
00081     char *extname;   // the current name of an active file extension
00082 
00083     bool save;
00084 
00085     // the following elements are used for WRITE-mode IMAGE-type pmFPAfiles to inform
00086     // the creation of a new image based on an existing image
00087     pmFPA *src;    // if an output FPA, inherit from this FPA
00088     int xBin;    // desired binning in x direction
00089     int yBin;    // desired binning in y direction
00090 
00091     psMetadata *camera;
00092     psMetadata *format;
00093 }
00094 pmFPAfile;
00095 
00096 // allocate an empty pmFPAfile structure
00097 pmFPAfile *pmFPAfileAlloc ();
00098 
00099 // select the readout from the named pmFPAfile; if the named file does not exist,
00100 pmReadout *pmFPAfileThisReadout (psMetadata *files, const pmFPAview *view, const char *name);
00101 
00102 // add the specified filename info (value) to the files of the given mode using the given reference name
00103 bool pmFPAfileAddFileNames (psMetadata *files, char *name, char *value, int mode);
00104 
00105 // convert the rule to a name based on the current view
00106 char *pmFPAfileNameFromRule (char *rule, pmFPAfile *file, const pmFPAview *view);
00107 
00108 bool pmFPAfileCopyView (pmFPA *out, pmFPA *in, const pmFPAview *view);
00109 
00110 bool pmFPAfileCopyStructureView (pmFPA *out, pmFPA *in, int xBin, int yBin, const pmFPAview *view);
00111 
00112 # endif

Generated on Mon Jul 3 14:24:27 2006 for Pan-STARRS Module Library by  doxygen 1.4.4