IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1496


Ignore:
Timestamp:
Aug 11, 2004, 3:23:20 PM (22 years ago)
Author:
desonia
Message:

doxygen cleanup.

Location:
trunk/psLib/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.h

    r1441 r1496  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:54 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-12 01:23:20 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    117117/** Projection type for projection/deprojection
    118118 *
    119  *  @seealso psProject, psDeproject
     119 *  @see psProject, psDeproject
    120120 *
    121121 */
     
    133133/** Parameter set for projection/deprojection
    134134 *
    135  *  @seealso psProject, psDeproject
     135 *  @see psProject, psDeproject
    136136 *
    137137 */
     
    148148/** Mode for Offset calculation between two sky positions
    149149 *
    150  *  @seealso  psSphereGetOffset, psSphereSetOffset
     150 *  @see  psSphereGetOffset, psSphereSetOffset
    151151 *
    152152 */
     
    158158/** The units of the offset
    159159 *
    160  *  @seealso  psSphereGetOffset, psSphereSetOffset
     160 *  @see  psSphereGetOffset, psSphereSetOffset
    161161 *
    162162 */
     
    170170/** Applies the psPlaneTransform transform to a specified coordinate
    171171 *
    172  */
    173 psPlane* psPlaneTransformApply(psPlane* out,   ///< a psPlane to recycle.  If NULL, a new one is generated.
    174                                const psPlaneTransform* transform,      ///< the transform to apply
    175                                const psPlane* coords   ///< the coordinate to apply the transform above.
    176                               );
     172 *  @return psPlane*     resulting coordinate based on transform
     173 */
     174psPlane* psPlaneTransformApply(
     175    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
     176    const psPlaneTransform* transform, ///< the transform to apply
     177    const psPlane* coords              ///< the coordinate to apply the transform above.
     178);
    177179
    178180/** Applies the psPlaneDistort transform to a specified coordinate
    179181 *
    180  */
    181 psPlane* psPlaneDistortApply(psPlane* out,     ///< a psPlane to recycle.  If NULL, a new one is generated.
    182                              const psPlaneDistort* transform,  ///< the transform to apply
    183                              const psPlane* coords,    ///< the coordinate to apply the transform above.
    184                              float term3,       ///< third term -- maybe magnitude
    185                              float term4        ///< forth term -- maybe color
    186                             );
     182 *  @return psPlane*     resulting coordinate based on transform
     183 */
     184psPlane* psPlaneDistortApply(
     185    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
     186    const psPlaneDistort* transform,   ///< the transform to apply
     187    const psPlane* coords,             ///< the coordinate to apply the transform above.
     188    float term3,                       ///< third term -- maybe magnitude
     189    float term4                        ///< forth term -- maybe color
     190);
    187191
    188192/** Allocator for psSphereTransform
    189193 *
    190  */
    191 psSphereTransform* psSphereTransformAlloc(double NPlat, ///< north pole latitude
    192         double Xo,    ///< First PT of Ares lon
    193         double xo     ///< First PT of Ares equiv lon
    194                                          );
     194 *  @return psSphereTransform*         newly allocated struct
     195 */
     196psSphereTransform* psSphereTransformAlloc(
     197    double NPlat,                      ///< north pole latitude
     198    double Xo,                         ///< First PT of Ares lon
     199    double xo                          ///< First PT of Ares equiv lon
     200);
    195201
    196202/** Applies the psSphereTransform transform for a specified coordinate
    197203 *
    198  */
    199 psSphere* psSphereTransformApply(psSphere* out,        ///< a psSphere to recycle.  If NULL, a new one is
    200                                  // generated.
    201                                  const psSphereTransform* transform,   ///< the transform to apply
    202                                  const psSphere* coord ///< the coordinate to apply the transform above.x
    203                                 );
    204 
    205 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time);
    206 
    207 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time);
    208 
     204 *  @return psSphere*      resulting coordinate based on transform
     205 */
     206psSphere* psSphereTransformApply(
     207    psSphere* out,                     ///< a psSphere to recycle.  If NULL, a new one is generated.
     208    const psSphereTransform* transform,///< the transform to apply
     209    const psSphere* coord              ///< the coordinate to apply the transform above.x
     210);
     211
     212/** Creates the appropriate transform for converting from ICRS to Ecliptic
     213 *  coordinate systems.
     214 *
     215 *  @return psSphereTransform*     transform for ICRS->Ecliptic coordinate systems
     216 */
     217psSphereTransform* psSphereTransformICRStoEcliptic(
     218    psTime time                        ///< the time for which the resulting transform will be valid
     219);
     220
     221/** Creates the appropriate transform for converting from Ecliptic to ICRS
     222 *  coordinate systems.
     223 *
     224 *  @return psSphereTransform*     transform for Ecliptic->ICRS coordinate systems
     225 */
     226psSphereTransform* psSphereTransformEcliptictoICRS(
     227    psTime time                        ///< the time for which the resulting transform will be valid
     228);
     229
     230/** Creates the appropriate transform for converting from ICRS to Galatic
     231 *  coordinate systems.
     232 *
     233 */
    209234psSphereTransform* psSphereTransformICRStoGalatic(void);
    210235
     236/** Creates the appropriate transform for converting from Galatic to ICRS
     237 *  coordinate systems.
     238 *
     239 */
    211240psSphereTransform* psSphereTransformGalatictoICRS(void);
    212241
    213 psPlane* psProject(const psSphere* coord, const psProjection* projection);
    214 
    215 psSphere* psDeproject(const psPlane* coord, const psProjection* projection);
    216 
    217 psSphere* psSphereGetOffset(const psSphere* restrict position1,
    218                             const psSphere* restrict position2,
    219                             psSphereOffsetMode mode, psSphereOffsetUnit unit);
    220 
    221 psSphere* psSphereSetOffset(const psSphere* restrict position,
    222                             const psSphere* restrict offset,
    223                             psSphereOffsetMode mode, psSphereOffsetUnit unit);
     242/** Projects a spherical coordinate to a linear coordinate system
     243 *
     244 *  @return psPlane*    projected coordinate
     245 */
     246psPlane* psProject(
     247    const psSphere* coord,             ///< coordinate to project
     248    const psProjection* projection     ///< parameters of the projection
     249);
     250
     251/** Reverse projection of a linear coordinate to a spherical coordinate system
     252 *
     253 *  @return psPlane*    projected coordinate
     254 */
     255psSphere* psDeproject(
     256    const psPlane* coord,              ///< coordinate to project
     257    const psProjection* projection     ///< parameters of the projection
     258);
     259
     260/** Determines the offset (RA,Dec) on the sky between two positions.
     261 *
     262 *  Both an offset mode and an offset unit may be defined. The mode may be
     263 *  either PS_SPHERICAL, in which case the specified offset corresponds to an
     264 *  offset in angles, or it may be PS_LINEAR, in which case the offset
     265 *  corresponds to a linear offset in a local projection. The offset unit may
     266 *  be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which
     267 *  specifies the units of the offset only.
     268 *
     269 *  @return psSphere*    the offset between position1 and position2
     270 */
     271psSphere* psSphereGetOffset(
     272    const psSphere* restrict position1,
     273    const psSphere* restrict position2,
     274    psSphereOffsetMode mode,
     275    psSphereOffsetUnit unit
     276);
     277
     278/** Applies the given offset to a coordinate.
     279 *
     280 *  Both an offset mode and an offset unit may be defined. The mode may be
     281 *  either PS_SPHERICAL, in which case the specified offset corresponds to an
     282 *  offset in angles, or it may be PS_LINEAR, in which case the offset
     283 *  corresponds to a linear offset in a local projection. The offset unit may
     284 *  be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which
     285 *  specifies the units of the offset only.
     286 *
     287 *  @return psSphere*    the given position with the given offset applied.
     288 */
     289psSphere* psSphereSetOffset(
     290    const psSphere* restrict position,
     291    const psSphere* restrict offset,
     292    psSphereOffsetMode mode,
     293    psSphereOffsetUnit unit
     294);
    224295
    225296/// @}
  • trunk/psLib/src/astro/psTime.h

    r1441 r1496  
    1313 *  @author Ross Harman, MHPCC
    1414 *
    15  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2004-08-09 23:40:54 $
     15 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-08-12 01:23:20 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3939/** Definition of psTime.
    4040 *
    41  *  The psTime struct is used by psLib to represent time values critical to astronomical calculations.  This
    42  *  structure represents a time which is equivalent to TAI (International Atomic Time) and is measured in
    43  *  both seconds and microseconds.
     41 *  The psTime struct is used by psLib to represent time values critical to
     42 *  astronomical calculations.  This structure represents a time which is
     43 *  equivalent to TAI (International Atomic Time) and is measured in both
     44 *  seconds and microseconds.
    4445 */
    4546typedef struct
    4647{
    47 
    48     time_t tv_sec;           /**< Seconds since epoch, Jan 1, 1970. */
    49 
    50     suseconds_t tv_usec;     /**< Microseconds since last second. */
     48    time_t tv_sec;                     ///< Seconds since epoch, Jan 1, 1970.
     49    suseconds_t tv_usec;               ///< Microseconds since last second.
    5150}
    5251psTime;
     
    6564 */
    6665
    67 psTime psTimeGetTime(void
    68                      /** No argument. */
    69                     );
     66psTime psTimeGetTime(void);
    7067
    7168/** Convert psTime to ISO time in TAI units.
    7269 *
    73  * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS. This function assumes
    74  * the input time already is in TAI time and does not add or subtract leapseconds.
     70 *  Converts psTime to a null terminated string in the form of:
     71 *  YYYY/MM/DD,HH:MM:SS.SSS. This function assumes the input time already is
     72 *  in TAI time and does not add or subtract leapseconds.
    7573 *
    7674 *  @return  char*: Pointer null terminated array of chars in ISO time.
    7775 */
    7876
    79 char *psTimeToISO(psTime time
    80                   /** Input time to be converted. */
    81                  );
     77char *psTimeToISO(
     78    psTime time                        ///< Input time to be converted.
     79);
    8280
    8381/** Convert psTime to UTC time.
    8482 *
    85  * Converts psTime to UTC time in double precision floating point notation. The input to this must already be
    86  * int TAI time. The result from this function is not in TAI units, but that of UTC, which does not contain
    87  * leapseconds.
     83 *  Converts psTime to UTC time in double precision floating point notation.
     84 *  The input to this must already be int TAI time. The result from this
     85 *  function is not in TAI units, but that of UTC, which does not contain
     86 *  leapseconds.
    8887 *
    8988 *  @return  psTime: UTC time psTime format.
    9089 */
    9190
    92 psTime psTimeToUTC(psTime time
    93                    /** Input time to be converted. */
    94                   );
     91psTime psTimeToUTC(
     92    psTime time                        ///< Input time to be converted.
     93);
    9594
    9695/** Convert psTime to modified Julian date time.
    9796 *
    98  * Converts psTime to modified Julian date (MJD) time. This function assumes the input time already is in TAI
    99  * time and does not add or subtract leapseconds.
     97 *  Converts psTime to modified Julian date (MJD) time. This function assumes
     98 *  the input time already is in TAI time and does not add or subtract
     99 *  leapseconds.
    100100 *
    101101 *  @return  double: Modified Julian Days (MJD) time.
    102102 */
    103 
    104 double psTimeToMJD(psTime time
    105                    /** Input time to be converted. */
    106                   );
     103double psTimeToMJD(
     104    psTime time                        ///< Input time to be converted.
     105);
    107106
    108107/** Convert psTime to Julian date time.
    109108 *
    110  * Converts psTime to Julian date (JD) time. This function assumes the input time already is in TAI time and
    111  * does not add or subtract leapseconds.
     109 *  Converts psTime to Julian date (JD) time. This function assumes the input
     110 *  time already is in TAI time and does not add or subtract leapseconds.
    112111 *
    113112 *  @return  double: Julian Date (JD) time.
    114113 */
    115 
    116 double psTimeToJD(psTime time
    117                   /** Input time to be converted. */
    118                  );
     114double psTimeToJD(
     115    psTime time                        ///< Input time to be converted.
     116);
    119117
    120118/** Convert psTime to timeval time.
    121119 *
    122  * Converts psTime to timeval time. This function assumes the input time already is in TAI time and does not
    123  * add or subtract leapseconds.
     120 *  Converts psTime to timeval time. This function assumes the input time
     121 *  already is in TAI time and does not add or subtract leapseconds.
    124122 *
    125123 *  @return  timeval: timeval struct time.
    126124 */
    127 
    128 struct timeval psTimeToTimeval(psTime time
    129                                            /** Input time to be converted. */
    130                                           );
     125struct timeval psTimeToTimeval(
     126                psTime time                        ///< Input time to be converted.
     127            );
    131128
    132129/** Convert psTime to tm time.
     
    137134 *  @return  tm: tm struct time.
    138135 */
    139 
    140 struct tm *psTimeToTM(psTime time
    141                                   /** Input time to be converted. */
    142                                  );
     136struct tm *psTimeToTM(
     137                psTime time                        ///< Input time to be converted.
     138            );
    143139
    144140/** Convert ISO to psTime.
    145141 *
    146  * Converts ISO time to psTime. This function assumes the input time already is in TAI time and does not add
    147  * or subtract leapseconds.
     142 *  Converts ISO time to psTime. This function assumes the input time already
     143 *  is in TAI time and does not add or subtract leapseconds.
    148144 *
    149145 *  @return  psTime: time
    150146 */
    151 
    152 psTime psISOToTime(char *time
    153                    /** Input time to be converted. */
    154                   );
     147psTime psISOToTime(
     148    char *time                         ///< Input time to be converted.
     149);
    155150
    156151/** Convert UTC to psTime.
    157152 *
    158  * Converts UTC time to psTime. This function assumes the input time already is in TAI time and add or
    159  * subtracts the necessary leapseconds.
     153 *  Converts UTC time to psTime. This function assumes the input time already
     154 *  is in TAI time and add or subtracts the necessary leapseconds.
    160155 *
    161156 *  @return  psTime: time in TAI units.
    162157 */
    163 
    164 psTime psUTCToTime(psTime time
    165                    /** Input time to be converted. */
    166                   );
     158psTime psUTCToTime(
     159    psTime time                        ///< Input time to be converted.
     160);
    167161
    168162/** Convert MJD to psTime.
    169163 *
    170  * Converts MJD time to psTime. This function assumes the input time already is in TAI time and does not add
    171  * or subtract leapseconds.
    172  *
    173  *  @return  psTime: time.
    174  */
    175 
    176 psTime psMJDToTime(double time
    177                    /** Input time to be converted. */
    178                   );
     164 *  Converts MJD time to psTime. This function assumes the input time already
     165 *  is in TAI time and does not add or subtract leapseconds.
     166 *
     167 *  @return  psTime: time.
     168 */
     169psTime psMJDToTime(
     170    double time                        ///< Input time to be converted.
     171);
    179172
    180173/** Convert JD to psTime.
    181174 *
    182  * Converts JD time to psTime. This function assumes the input time already is in TAI time and does not add
    183  * or subtract leapseconds.
    184  *
    185  *  @return  psTime: time.
    186  */
    187 
    188 psTime psJDToTime(double time
    189                   /** Input time to be converted. */
    190                  );
     175 *  Converts JD time to psTime. This function assumes the input time already
     176 *  is in TAI time and does not add or subtract leapseconds.
     177 *
     178 *  @return  psTime: time.
     179 */
     180psTime psJDToTime(
     181    double time                        ///< Input time to be converted.
     182);
    191183
    192184/** Convert timeval to psTime.
    193185 *
    194  * Converts timeval time to psTime. This function assumes the input time already is in TAI time and does not
    195  * add or subtract leapseconds.
    196  *
    197  *  @return  psTime: time.
    198  */
    199 
    200 psTime psTimevalToTime(struct timeval *time
    201                        /** Input time to be converted. */
    202                       );
     186 *  Converts timeval time to psTime. This function assumes the input time
     187 *  already is in TAI time and does not add or subtract leapseconds.
     188 *
     189 *  @return  psTime: time.
     190 */
     191psTime psTimevalToTime(
     192    struct timeval *time               ///< Input time to be converted.
     193);
    203194
    204195/** Convert tm time to psTime.
    205196 *
    206  * Converts tm time to psTime. This function assumes the input time already is in TAI time and does not add
    207  * or subtract leapseconds.
    208  *
    209  *  @return  psTime: time.
    210  */
    211 
    212 psTime psTMToTime(struct tm *time
    213                   /** Input time to be converted. */
    214                  );
     197 *  Converts tm time to psTime. This function assumes the input time already
     198 *  is in TAI time and does not add or subtract leapseconds.
     199 *
     200 *  @return  psTime: time.
     201 */
     202psTime psTMToTime(
     203    struct tm *time                    ///< Input time to be converted.
     204);
    215205
    216206/// @}
  • trunk/psLib/src/astronomy/psAstrometry.h

    r1489 r1496  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-11 23:33:44 $
     10*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-12 01:23:20 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4444typedef struct
    4545{
    46     const double latitude;      ///< geodetic latitude (radians)
    47     const double sinLat;        ///< sine of geodetic latitude
    48     const double cosLat;        ///< cosine of geodetic latitude
    49     const double abberationMag; ///< magnitude of diurnal aberration vector
    50     const double height;        ///< height (HM)
    51     const double temperature;   ///< ambient temperature (TDK)
    52     const double pressure;      ///< pressure (PMB)
    53     const double humidity;      ///< relative humidity (RH)
    54     const double wavelength;    ///< wavelength (WL)
    55     const double lapseRate;     ///< lapse rate (TLR)
    56     const double refractA;      ///< refraction constant A (radians)
    57     const double refractB;      ///< refraction constant B (radians)
    58     const double longitudeOffset; ///< longitude + ... (radians)
    59     const double siderealTime;  ///< local apparent sidereal time (radians)
     46    const double latitude;             ///< geodetic latitude (radians)
     47    const double sinLat;               ///< sine of geodetic latitude
     48    const double cosLat;               ///< cosine of geodetic latitude
     49    const double abberationMag;        ///< magnitude of diurnal aberration vector
     50    const double height;               ///< height (HM)
     51    const double temperature;          ///< ambient temperature (TDK)
     52    const double pressure;             ///< pressure (PMB)
     53    const double humidity;             ///< relative humidity (RH)
     54    const double wavelength;           ///< wavelength (WL)
     55    const double lapseRate;            ///< lapse rate (TLR)
     56    const double refractA;             ///< refraction constant A (radians)
     57    const double refractB;             ///< refraction constant B (radians)
     58    const double longitudeOffset;      ///< longitude + ... (radians)
     59    const double siderealTime;         ///< local apparent sidereal time (radians)
    6060}
    6161psGrommit;
     
    7272typedef struct
    7373{
    74     int nX;                     ///< Number of elements in x direction
    75     int nY;                     ///< Number of elements in y direction
    76     double x0;                  ///< X Position of 0,0 corner on focal plane
    77     double y0;                  ///< Y Position of 0,0 corner on focal plane
    78     double xScale;              ///< Scale of the grid in x direction
    79     double yScale;              ///< Scale of the grid in x direction
    80     double **x;                 ///< The grid of offsets in x
    81     double **y;                 ///< The grid of offsets in y
     74    int nX;                            ///< Number of elements in x direction
     75    int nY;                            ///< Number of elements in y direction
     76    double x0;                         ///< X Position of 0,0 corner on focal plane
     77    double y0;                         ///< Y Position of 0,0 corner on focal plane
     78    double xScale;                     ///< Scale of the grid in x direction
     79    double yScale;                     ///< Scale of the grid in x direction
     80    double **x;                        ///< The grid of offsets in x
     81    double **y;                        ///< The grid of offsets in y
    8282}
    8383psFixedPattern;
     
    9494typedef struct
    9595{
    96     const unsigned int colBins; ///< Amount of binning in x-dimension
    97     const unsigned int rowBins; ///< Amount of binning in y-dimension
    98     const int col0;             ///< Offset from the left of chip.
    99     const int row0;             ///< Offset from the bottom of chip.
    100 
    101     psImage* image;             ///< imaging area of Readout
    102     psList* objects;            ///< objects derived from Readout
    103     psMetadata* metadata;       ///< readout-level metadata
     96    const unsigned int colBins;        ///< Amount of binning in x-dimension
     97    const unsigned int rowBins;        ///< Amount of binning in y-dimension
     98    const int col0;                    ///< Offset from the left of chip.
     99    const int row0;                    ///< Offset from the bottom of chip.
     100
     101    psImage* image;                    ///< imaging area of Readout
     102    psList* objects;                   ///< objects derived from Readout
     103    psMetadata* metadata;              ///< readout-level metadata
    104104}
    105105psReadout;
     
    116116typedef struct psCell
    117117{
    118     psArray* readouts;          ///< readouts from the cell
    119     psMetadata* metadata;       ///< cell-level metadata
    120 
    121     psPlaneTransform* toChip;   ///< transformations from cell to chip coordinates
    122     psPlaneTransform* fromChip; ///< transformations from chip to cell coordinates
    123     psPlaneTransform* toFPA;    ///< transformations from cell to FPA coordinates
    124     psPlaneTransform* toTP;     ///< transformations from cell to tangent plane coordinates
    125 
    126     struct psChip* parent;      ///< chip in which contains this cell
     118    psArray* readouts;                 ///< readouts from the cell
     119    psMetadata* metadata;              ///< cell-level metadata
     120
     121    psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
     122    psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
     123    psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
     124    psPlaneTransform* toTP;            ///< transformations from cell to tangent plane coordinates
     125
     126    struct psChip* parent;             ///< chip in which contains this cell
    127127}
    128128psCell;
     
    138138typedef struct psChip
    139139{
    140     psArray* cells;             ///< cells in the chip
    141     psMetadata* metadata;       ///< chip-level metadata
    142 
    143     psPlaneTransform* toFPA;    ///< transformation from chip to FPA coordinates
    144     psPlaneTransform* fromFPA;  ///< transformation from FPA to chip coordinates
    145 
    146     struct psFPA* parent;       ///< FPA which contains this chip
     140    psArray* cells;                    ///< cells in the chip
     141    psMetadata* metadata;              ///< chip-level metadata
     142
     143    psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
     144    psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
     145
     146    struct psFPA* parent;              ///< FPA which contains this chip
    147147}
    148148psChip;
  • trunk/psLib/src/astronomy/psCoord.h

    r1441 r1496  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:54 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-12 01:23:20 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    117117/** Projection type for projection/deprojection
    118118 *
    119  *  @seealso psProject, psDeproject
     119 *  @see psProject, psDeproject
    120120 *
    121121 */
     
    133133/** Parameter set for projection/deprojection
    134134 *
    135  *  @seealso psProject, psDeproject
     135 *  @see psProject, psDeproject
    136136 *
    137137 */
     
    148148/** Mode for Offset calculation between two sky positions
    149149 *
    150  *  @seealso  psSphereGetOffset, psSphereSetOffset
     150 *  @see  psSphereGetOffset, psSphereSetOffset
    151151 *
    152152 */
     
    158158/** The units of the offset
    159159 *
    160  *  @seealso  psSphereGetOffset, psSphereSetOffset
     160 *  @see  psSphereGetOffset, psSphereSetOffset
    161161 *
    162162 */
     
    170170/** Applies the psPlaneTransform transform to a specified coordinate
    171171 *
    172  */
    173 psPlane* psPlaneTransformApply(psPlane* out,   ///< a psPlane to recycle.  If NULL, a new one is generated.
    174                                const psPlaneTransform* transform,      ///< the transform to apply
    175                                const psPlane* coords   ///< the coordinate to apply the transform above.
    176                               );
     172 *  @return psPlane*     resulting coordinate based on transform
     173 */
     174psPlane* psPlaneTransformApply(
     175    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
     176    const psPlaneTransform* transform, ///< the transform to apply
     177    const psPlane* coords              ///< the coordinate to apply the transform above.
     178);
    177179
    178180/** Applies the psPlaneDistort transform to a specified coordinate
    179181 *
    180  */
    181 psPlane* psPlaneDistortApply(psPlane* out,     ///< a psPlane to recycle.  If NULL, a new one is generated.
    182                              const psPlaneDistort* transform,  ///< the transform to apply
    183                              const psPlane* coords,    ///< the coordinate to apply the transform above.
    184                              float term3,       ///< third term -- maybe magnitude
    185                              float term4        ///< forth term -- maybe color
    186                             );
     182 *  @return psPlane*     resulting coordinate based on transform
     183 */
     184psPlane* psPlaneDistortApply(
     185    psPlane* out,                      ///< a psPlane to recycle.  If NULL, a new one is generated.
     186    const psPlaneDistort* transform,   ///< the transform to apply
     187    const psPlane* coords,             ///< the coordinate to apply the transform above.
     188    float term3,                       ///< third term -- maybe magnitude
     189    float term4                        ///< forth term -- maybe color
     190);
    187191
    188192/** Allocator for psSphereTransform
    189193 *
    190  */
    191 psSphereTransform* psSphereTransformAlloc(double NPlat, ///< north pole latitude
    192         double Xo,    ///< First PT of Ares lon
    193         double xo     ///< First PT of Ares equiv lon
    194                                          );
     194 *  @return psSphereTransform*         newly allocated struct
     195 */
     196psSphereTransform* psSphereTransformAlloc(
     197    double NPlat,                      ///< north pole latitude
     198    double Xo,                         ///< First PT of Ares lon
     199    double xo                          ///< First PT of Ares equiv lon
     200);
    195201
    196202/** Applies the psSphereTransform transform for a specified coordinate
    197203 *
    198  */
    199 psSphere* psSphereTransformApply(psSphere* out,        ///< a psSphere to recycle.  If NULL, a new one is
    200                                  // generated.
    201                                  const psSphereTransform* transform,   ///< the transform to apply
    202                                  const psSphere* coord ///< the coordinate to apply the transform above.x
    203                                 );
    204 
    205 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time);
    206 
    207 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time);
    208 
     204 *  @return psSphere*      resulting coordinate based on transform
     205 */
     206psSphere* psSphereTransformApply(
     207    psSphere* out,                     ///< a psSphere to recycle.  If NULL, a new one is generated.
     208    const psSphereTransform* transform,///< the transform to apply
     209    const psSphere* coord              ///< the coordinate to apply the transform above.x
     210);
     211
     212/** Creates the appropriate transform for converting from ICRS to Ecliptic
     213 *  coordinate systems.
     214 *
     215 *  @return psSphereTransform*     transform for ICRS->Ecliptic coordinate systems
     216 */
     217psSphereTransform* psSphereTransformICRStoEcliptic(
     218    psTime time                        ///< the time for which the resulting transform will be valid
     219);
     220
     221/** Creates the appropriate transform for converting from Ecliptic to ICRS
     222 *  coordinate systems.
     223 *
     224 *  @return psSphereTransform*     transform for Ecliptic->ICRS coordinate systems
     225 */
     226psSphereTransform* psSphereTransformEcliptictoICRS(
     227    psTime time                        ///< the time for which the resulting transform will be valid
     228);
     229
     230/** Creates the appropriate transform for converting from ICRS to Galatic
     231 *  coordinate systems.
     232 *
     233 */
    209234psSphereTransform* psSphereTransformICRStoGalatic(void);
    210235
     236/** Creates the appropriate transform for converting from Galatic to ICRS
     237 *  coordinate systems.
     238 *
     239 */
    211240psSphereTransform* psSphereTransformGalatictoICRS(void);
    212241
    213 psPlane* psProject(const psSphere* coord, const psProjection* projection);
    214 
    215 psSphere* psDeproject(const psPlane* coord, const psProjection* projection);
    216 
    217 psSphere* psSphereGetOffset(const psSphere* restrict position1,
    218                             const psSphere* restrict position2,
    219                             psSphereOffsetMode mode, psSphereOffsetUnit unit);
    220 
    221 psSphere* psSphereSetOffset(const psSphere* restrict position,
    222                             const psSphere* restrict offset,
    223                             psSphereOffsetMode mode, psSphereOffsetUnit unit);
     242/** Projects a spherical coordinate to a linear coordinate system
     243 *
     244 *  @return psPlane*    projected coordinate
     245 */
     246psPlane* psProject(
     247    const psSphere* coord,             ///< coordinate to project
     248    const psProjection* projection     ///< parameters of the projection
     249);
     250
     251/** Reverse projection of a linear coordinate to a spherical coordinate system
     252 *
     253 *  @return psPlane*    projected coordinate
     254 */
     255psSphere* psDeproject(
     256    const psPlane* coord,              ///< coordinate to project
     257    const psProjection* projection     ///< parameters of the projection
     258);
     259
     260/** Determines the offset (RA,Dec) on the sky between two positions.
     261 *
     262 *  Both an offset mode and an offset unit may be defined. The mode may be
     263 *  either PS_SPHERICAL, in which case the specified offset corresponds to an
     264 *  offset in angles, or it may be PS_LINEAR, in which case the offset
     265 *  corresponds to a linear offset in a local projection. The offset unit may
     266 *  be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which
     267 *  specifies the units of the offset only.
     268 *
     269 *  @return psSphere*    the offset between position1 and position2
     270 */
     271psSphere* psSphereGetOffset(
     272    const psSphere* restrict position1,
     273    const psSphere* restrict position2,
     274    psSphereOffsetMode mode,
     275    psSphereOffsetUnit unit
     276);
     277
     278/** Applies the given offset to a coordinate.
     279 *
     280 *  Both an offset mode and an offset unit may be defined. The mode may be
     281 *  either PS_SPHERICAL, in which case the specified offset corresponds to an
     282 *  offset in angles, or it may be PS_LINEAR, in which case the offset
     283 *  corresponds to a linear offset in a local projection. The offset unit may
     284 *  be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which
     285 *  specifies the units of the offset only.
     286 *
     287 *  @return psSphere*    the given position with the given offset applied.
     288 */
     289psSphere* psSphereSetOffset(
     290    const psSphere* restrict position,
     291    const psSphere* restrict offset,
     292    psSphereOffsetMode mode,
     293    psSphereOffsetUnit unit
     294);
    224295
    225296/// @}
  • trunk/psLib/src/astronomy/psMetadata.h

    r1441 r1496  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:54 $
     13*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-12 01:23:20 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434 */
    3535typedef enum {
    36     PS_META_ITEM_SET = 0,       ///< Null. Metadata is in psMetadataItem.items
    37     PS_META_BOOL,                          ///< Boolean data.
    38     PS_META_S32,                           ///< Signed 32-bit integer data.
    39     PS_META_F32,                           ///< Single-precision float data.
    40     PS_META_F64,                           ///< Double-precision float data.
    41     PS_META_STR,                           ///< String data (Stored in as void *).
    42     PS_META_IMG,                           ///< Image data (Stored in as void *).
    43     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    44     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    45     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    46     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
    47     PS_META_NTYPE                          ///< Number of types. Must be last.
     36    PS_META_ITEM_SET = 0,              ///< Null. Metadata is in psMetadataItem.items
     37    PS_META_BOOL,                      ///< Boolean data.
     38    PS_META_S32,                       ///< Signed 32-bit integer data.
     39    PS_META_F32,                       ///< Single-precision float data.
     40    PS_META_F64,                       ///< Double-precision float data.
     41    PS_META_STR,                       ///< String data (Stored in as void *).
     42    PS_META_IMG,                       ///< Image data (Stored in as void *).
     43    PS_META_JPEG,                      ///< JPEG data (Stored in as void *).
     44    PS_META_PNG,                       ///< PNG data (Stored in as void *).
     45    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as void *).
     46    PS_META_UNKNOWN,                   ///< Other data (Stored in as void *).
     47    PS_META_NTYPE                      ///< Number of types. Must be last.
    4848} psMetadataType;
    4949
     
    5555typedef struct psMetadataItem
    5656{
    57     const int id;               ///< Unique ID for metadata item.
    58     char *restrict name;        ///< Name of metadata item.
    59     psMetadataType type;        ///< Type of metadata item.
     57    const int id;                      ///< Unique ID for metadata item.
     58    char *restrict name;               ///< Name of metadata item.
     59    psMetadataType type;               ///< Type of metadata item.
    6060    union {
    61         bool B;
    62         psS32 S32;              ///< Signed 32-bit integer data.
    63         psF32 F32;              ///< Single-precision float data.
    64         psF64 F64;              ///< Double-precision float data.
    65         psPTR V;                ///< Pointer to other type of data.
    66     } data;                     ///< Union for data types.
    67     char *comment;              ///< Optional comment ("", not NULL).
    68     psList* restrict items;     ///< List of psMetadataItems with same name.
     61        bool B;                        ///< boolean data
     62        psS32 S32;                     ///< Signed 32-bit integer data.
     63        psF32 F32;                     ///< Single-precision float data.
     64        psF64 F64;                     ///< Double-precision float data.
     65        psPTR V;                       ///< Pointer to other type of data.
     66    } data;                            ///< Union for data types.
     67    char *comment;                     ///< Optional comment ("", not NULL).
     68    psList* restrict items;            ///< List of psMetadataItems with same name.
    6969}
    7070psMetadataItem;
     
    7272/** Metadata data structure.
    7373 *
    74  * Struct for holding metadata items. Metadata items are held in two containers. The first employs a
    75  * doubly-linked list to preserve the order of the metadata. The second container employs a hash table which
    76  * allows fast lookup when given a metadata keyword.
     74 *  Struct for holding metadata items. Metadata items are held in two
     75 *  containers. The first employs a doubly-linked list to preserve the order
     76 *  of the metadata. The second container employs a hash table which
     77 *  allows fast lookup when given a metadata keyword.
    7778 */
    7879typedef struct psMetadata
    7980{
    80     psList* restrict list;
    81     psHash* restrict table;
     81    psList* restrict list;             ///< the metadata in linked-list
     82    psHash* restrict table;            ///< the metadata in a hash table
    8283}
    8384psMetadata;
     
    9192/** Create a metadata item.
    9293 *
    93  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    94  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    95  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    96  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    97  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    98  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    99  * by the va_list operators in the function.
    100  * specified size and type.
    101  *
    102  * @return psMetadataItem* : Pointer metadata item.
    103  */
    104 psMetadataItem* psMetadataItemAlloc(const char *name,   ///< Name of metadata item.
    105                                     psMetadataType type,        ///< Type of metadata item.
    106                                     const char *comment,        ///< Comment for metadata item.
    107                                     ... ///< Arguments for name formatting and metadata item data.
    108                                    );
     94 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     95 *  struct. The name argument specifies the name to use for this item, and
     96 *  may include sprintf formatting codes. The format entry specifies both
     97 *  the metadata type and optional flags and is created by bit-wise or of the
     98 *  appropriate type and flag. The comment argument is a fixed string used to
     99 *  comment the metadata item. The arguments to the name formatting codes and
     100 *  the metadata itself are passed as arguments following the comment string.
     101 *  The data must be a pointer for any of the elements stored in data.void.
     102 *  The argument list must be interpreted appropriately by the va_list
     103 *  operators in the function specified size and type.
     104 *
     105 * @return psMetadataItem* : Pointer metadata item.
     106 */
     107psMetadataItem* psMetadataItemAlloc(
     108    const char *name,                  ///< Name of metadata item.
     109    psMetadataType type,               ///< Type of metadata item.
     110    const char *comment,               ///< Comment for metadata item.
     111    ...                                ///< Arguments for name formatting and metadata item data.
     112);
    109113
    110114/** Create a metadata item with va_list.
    111115 *
    112  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    113  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    114  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    115  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    116  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    117  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    118  * by the va_list operators in the function.
    119  * specified size and type.
    120  *
    121  * @return psMetadataItem* : Pointer metadata item.
    122  */
    123 psMetadataItem* psMetadataItemAllocV(const char *name,  ///< Name of metadata item.
    124                                      psMetadataType type,       ///< Type of metadata item.
    125                                      const char *comment,       ///< Comment for metadata item.
    126                                      va_list list       ///< Arguments for name formatting and metadata item
    127                                      // data.
    128                                     );
     116 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     117 *  struct. The name argument specifies the name to use for this item, and
     118 *  may include sprintf formatting codes. The format entry specifies both
     119 *  the metadata type and optional flags and is created by bit-wise or of the
     120 *  appropriate type and flag. The comment argument is a fixed string used to
     121 *  comment the metadata item. The arguments to the name formatting codes and
     122 *  the metadata itself are passed as arguments following the comment string.
     123 *  The data must be a pointer for any of the elements stored in data.void.
     124 *  The argument list must be interpreted appropriately by the va_list
     125 *  operators in the function specified size and type.
     126 *
     127 * @return psMetadataItem* : Pointer metadata item.
     128 */
     129psMetadataItem* psMetadataItemAllocV(
     130    const char *name,                  ///< Name of metadata item.
     131    psMetadataType type,               ///< Type of metadata item.
     132    const char *comment,               ///< Comment for metadata item.
     133    va_list list                       ///< Arguments for name formatting and metadata item data.
     134);
    129135
    130136/** Create a metadata collection.
    131137 *
    132  * Returns an empty metadata container with fully allocated internal metadata containers.
    133  *
    134  * @return psMetadata* : Pointer metadata.
    135  */
    136 psMetadata* psMetadataAlloc(void        ///< Void.
    137                            );
     138 *  Returns an empty metadata container with fully allocated internal metadata
     139 *  containers.
     140 *
     141 *  @return psMetadata* : Pointer metadata.
     142 */
     143psMetadata* psMetadataAlloc(void);
    138144
    139145/** Add existing metadata item to metadata collection.
    140146 *
    141  * Add a metadata item that has already been created to the metadata collection.
     147 *  Add a metadata item that has already been created to the metadata
     148 *  collection.
     149 *
     150 *  @return bool: True for success, false for failure.
     151 */
     152bool psMetadataAddItem(
     153    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     154    int where,                         ///< Location to be added.
     155    psMetadataItem* restrict item      ///< Metadata item to be added.
     156);
     157
     158/** Create and add a metadata item to metadata collection.
     159 *
     160 * Creates a new metadata item add to the metadata collection.
    142161 *
    143162 * @return bool: True for success, false for failure.
    144163 */
    145 bool psMetadataAddItem(psMetadata* restrict md,        ///< Metadata collection to insert metadat item.
    146                        int where,       ///< Location to be added.
    147                        psMetadataItem* restrict item   ///< Metadata item to be added.
    148                       );
    149 
    150 /** Create and add a metadata item to metadata collection.
    151  *
    152  * Creates a new metadata item add to the metadata collection.
     164bool psMetadataAdd(
     165    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     166    int where,                         ///< Location to be added.
     167    const char *name,                  ///< Name of metadata item.
     168    psMetadataType type,               ///< Type of metadata item.
     169    const char *comment,               ///< Comment for metadata item.
     170    ...                                ///< Arguments for name formatting and metadata item data.
     171);
     172
     173/** Remove an item from metadata collection.
     174 *
     175 *  Items may be removed from metadata by specifing a key or location. If the
     176 *  name is null, the where argument is used instead. If name is not null,
     177 *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
     178 *  the metadata and true is returned.  If the key is not unique, then all
     179 *  items corresponding to it are removed.
    153180 *
    154181 * @return bool: True for success, false for failure.
    155182 */
    156 bool psMetadataAdd(psMetadata* restrict md,    ///< Metadata collection to insert metadat item.
    157                    int where,   ///< Location to be added.
    158                    const char *name,    ///< Name of metadata item.
    159                    psMetadataType type, ///< Type of metadata item.
    160                    const char *comment, ///< Comment for metadata item.
    161                    ...          ///< Arguments for name formatting and metadata item data.
    162                   );
    163 
    164 /** Remove an item from metadata collection.
    165  *
    166  * Items may be removed from metadata by specifing a key or location. If the name is null, the where argument
    167  * is used instead. If name is not null, where is set to PS_LIST_UNKNOWN. If the item is found, it is removed
    168  * from the metadata and true is returned.  If the key is not unique, then all items corresponding to it are
    169  * removed.
    170  *
    171  * @return bool: True for success, false for failure.
    172  */
    173 bool psMetadataRemove(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    174                       int where,        ///< Location to be removed.
    175                       const char *restrict key  ///< Name of metadata key.
    176                      );
     183bool psMetadataRemove(
     184    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     185    int where,                         ///< Location to be removed.
     186    const char *restrict key           ///< Name of metadata key.
     187);
    177188
    178189/** Find an item in the metadata collection based on key name.
    179190 *
    180  * Items may be found in the metadata by providing a key. If the key is non-unique, the first item is
    181  * returned. If the item is not found, null is returned.
    182  *
    183  * @return psMetadataItem* : Pointer metadata item.
    184  */
    185 psMetadataItem* psMetadataLookup(psMetadata* restrict md,      ///< Metadata collection to insert metadat
    186                                  // item.
    187                                  const char *restrict key       ///< Name of metadata key.
    188                                 );
     191 *  Items may be found in the metadata by providing a key. If the key is
     192 *  non-unique, the first item is returned. If the item is not found, null is
     193 *  returned.
     194 *
     195 * @return psMetadataItem* : Pointer metadata item.
     196 */
     197psMetadataItem* psMetadataLookup(
     198    psMetadata* restrict md,           ///< Metadata collection to insert metadata item.
     199    const char *restrict key           ///< Name of metadata key.
     200);
    189201
    190202/** Find an item in the metadata collection based on list index.
    191203 *
    192  * Items may be found in the metadata by their entry position in the list container.
    193  *
    194  * @return psMetadataItem* : Pointer metadata item.
    195  */
    196 psMetadataItem* psMetadataGet(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    197                               int where ///< Location to be retrieved.
    198                              );
     204 *  Items may be found in the metadata by their entry position in the list
     205 *  container.
     206 *
     207 *  @return psMetadataItem* : Pointer metadata item.
     208 */
     209psMetadataItem* psMetadataGet(
     210    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     211    int where                          ///< Location to be retrieved.
     212);
    199213
    200214/** Set or reset metadata iterator.
    201215 *
    202  * Metadata may be iterated by setting or resetting an iterator to a location in the metadata list.
     216 *  Metadata may be iterated by setting or resetting an iterator to a location
     217 *  in the metadata list.
    203218 *
    204219 * @return void: void.
    205220 */
    206 bool psMetadataSetIterator(psMetadata* restrict md,    ///< Metadata collection to iterate.
    207                            int where    ///< Location of iterator.
    208                           );
     221bool psMetadataSetIterator(
     222    psMetadata* restrict md,           ///< Metadata collection to iterate.
     223    int where                          ///< Location of iterator.
     224);
    209225
    210226/** Get next metadata item.
     
    214230 * @return psMetadataItem* : Pointer metadata item.
    215231 */
    216 psMetadataItem* psMetadataGetNext(psMetadata* restrict md,     ///< Metadata collection to iterate.
    217                                   const char *restrict match,   ///< Beginning of key name.
    218                                   int which     ///< Iterator to be used.
    219                                  );
     232psMetadataItem* psMetadataGetNext(
     233    psMetadata* restrict md,           ///< Metadata collection to iterate.
     234    const char *restrict match,        ///< Beginning of key name.
     235    int which                          ///< Iterator to be used.
     236);
    220237
    221238/** Get previous metadata item.
     
    225242 * @return psMetadataItem* : Pointer metadata item.
    226243 */
    227 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, ///< Metadata collection to iterate.
    228                                       const char *restrict match,       ///< Beginning of key name.
    229                                       int which ///< Iterator to be used.
    230                                      );
     244psMetadataItem* psMetadataGetPrevious(
     245    psMetadata* restrict md,           ///< Metadata collection to iterate.
     246    const char *restrict match,        ///< Beginning of key name.
     247    int which                          ///< Iterator to be used.
     248);
    231249
    232250/** Print metadata item to file.
    233251 *
    234  * Metadata items may be printed to an open file descriptor based on a provided format. The format is a
    235  * sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric
    236  * type, this formatting command must also be numeric, and the type conversion performed to the value to match
    237  * the format type. If the metadata type is a string, the fromatting command must also be for a string. If the
    238  * metadata type is any other data type, printing is not allowed.
    239  *
    240  * @return psMetadataItem* : Pointer metadata item.
    241  */
    242 void psMetadataItemPrint(FILE * fd,     ///< Pointer to file to write metadata item.
    243                          const char *format,    ///< Format to print metadata item.
    244                          const psMetadataItem* restrict metadataItem   ///< Metadata item to print.
    245                         );
     252 *  Metadata items may be printed to an open file descriptor based on a
     253 *  provided format. The format is a sprintf format statement with exactly
     254 *  one % formatting command. If the metadata item type is a numeric type,
     255 *  this formatting command must also be numeric, and the type conversion
     256 *  performed to the value to match the format type. If the metadata type is
     257 *  a string, the fromatting command must also be for a string. If the
     258 *  metadata type is any other data type, printing is not allowed.
     259 *
     260 * @return psMetadataItem* : Pointer metadata item.
     261 */
     262void psMetadataItemPrint(
     263    FILE * fd,                         ///< Pointer to file to write metadata item.
     264    const char *format,                ///< Format to print metadata item.
     265    const psMetadataItem* restrict metadataItem ///< Metadata item to print.
     266);
    246267
    247268/** Read metadata header.
    248269 *
    249  * Read a metadata header from file. If the file is not found, an error is reported. This file is currently
    250  * unimplemented.
    251  *
    252  * @return psMetadata* : Pointer metadata.
    253  */
    254 psMetadata* psMetadataReadHeader(psMetadata* output,   ///< Resulting metadata from read.
    255                                  char *extname, ///< File name extension string.
    256                                  int extnum,    ///< File name extension number. Starts at 1.
    257                                  char *filename ///< Name of file to read.
    258                                 );
     270 *  Read a metadata header from file. If the file is not found, an error is
     271 *  reported. This file is currently unimplemented.
     272 *
     273 *  @return psMetadata* : Pointer metadata.
     274 */
     275psMetadata* psMetadataReadHeader(
     276    psMetadata* output,                ///< Resulting metadata from read.
     277    char *extname,                     ///< File name extension string.
     278    int extnum,                        ///< File name extension number. Starts at 1.
     279    char *filename                     ///< Name of file to read.
     280);
    259281
    260282/** Read metadata header.
    261283 *
    262  * Read a metadata header from file. If the file is not found, an error is reported.
    263  *
    264  * @return psMetadata* : Pointer metadata.
    265  */
    266 psMetadata* psMetadataFReadHeader(psMetadata* output,  ///< Resulting metadata from read.
    267                                   char *extName,        ///< File name extension string.
    268                                   int extNum,   ///< File name extension number.
    269                                   fitsfile * fd ///< Pointer to file to read.
    270                                  );
     284 *  Read a metadata header from file. If the file is not found, an error is
     285 *  reported.
     286 *
     287 *  @return psMetadata* : Pointer metadata.
     288 */
     289psMetadata* psMetadataFReadHeader(
     290    psMetadata* output,                ///< Resulting metadata from read.
     291    char *extName,                     ///< File name extension string.
     292    int extNum,                        ///< File name extension number.
     293    fitsfile * fd                      ///< Pointer to file to read.
     294);
    271295
    272296/// @}
  • trunk/psLib/src/astronomy/psTime.h

    r1441 r1496  
    1313 *  @author Ross Harman, MHPCC
    1414 *
    15  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2004-08-09 23:40:54 $
     15 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-08-12 01:23:20 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3939/** Definition of psTime.
    4040 *
    41  *  The psTime struct is used by psLib to represent time values critical to astronomical calculations.  This
    42  *  structure represents a time which is equivalent to TAI (International Atomic Time) and is measured in
    43  *  both seconds and microseconds.
     41 *  The psTime struct is used by psLib to represent time values critical to
     42 *  astronomical calculations.  This structure represents a time which is
     43 *  equivalent to TAI (International Atomic Time) and is measured in both
     44 *  seconds and microseconds.
    4445 */
    4546typedef struct
    4647{
    47 
    48     time_t tv_sec;           /**< Seconds since epoch, Jan 1, 1970. */
    49 
    50     suseconds_t tv_usec;     /**< Microseconds since last second. */
     48    time_t tv_sec;                     ///< Seconds since epoch, Jan 1, 1970.
     49    suseconds_t tv_usec;               ///< Microseconds since last second.
    5150}
    5251psTime;
     
    6564 */
    6665
    67 psTime psTimeGetTime(void
    68                      /** No argument. */
    69                     );
     66psTime psTimeGetTime(void);
    7067
    7168/** Convert psTime to ISO time in TAI units.
    7269 *
    73  * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS. This function assumes
    74  * the input time already is in TAI time and does not add or subtract leapseconds.
     70 *  Converts psTime to a null terminated string in the form of:
     71 *  YYYY/MM/DD,HH:MM:SS.SSS. This function assumes the input time already is
     72 *  in TAI time and does not add or subtract leapseconds.
    7573 *
    7674 *  @return  char*: Pointer null terminated array of chars in ISO time.
    7775 */
    7876
    79 char *psTimeToISO(psTime time
    80                   /** Input time to be converted. */
    81                  );
     77char *psTimeToISO(
     78    psTime time                        ///< Input time to be converted.
     79);
    8280
    8381/** Convert psTime to UTC time.
    8482 *
    85  * Converts psTime to UTC time in double precision floating point notation. The input to this must already be
    86  * int TAI time. The result from this function is not in TAI units, but that of UTC, which does not contain
    87  * leapseconds.
     83 *  Converts psTime to UTC time in double precision floating point notation.
     84 *  The input to this must already be int TAI time. The result from this
     85 *  function is not in TAI units, but that of UTC, which does not contain
     86 *  leapseconds.
    8887 *
    8988 *  @return  psTime: UTC time psTime format.
    9089 */
    9190
    92 psTime psTimeToUTC(psTime time
    93                    /** Input time to be converted. */
    94                   );
     91psTime psTimeToUTC(
     92    psTime time                        ///< Input time to be converted.
     93);
    9594
    9695/** Convert psTime to modified Julian date time.
    9796 *
    98  * Converts psTime to modified Julian date (MJD) time. This function assumes the input time already is in TAI
    99  * time and does not add or subtract leapseconds.
     97 *  Converts psTime to modified Julian date (MJD) time. This function assumes
     98 *  the input time already is in TAI time and does not add or subtract
     99 *  leapseconds.
    100100 *
    101101 *  @return  double: Modified Julian Days (MJD) time.
    102102 */
    103 
    104 double psTimeToMJD(psTime time
    105                    /** Input time to be converted. */
    106                   );
     103double psTimeToMJD(
     104    psTime time                        ///< Input time to be converted.
     105);
    107106
    108107/** Convert psTime to Julian date time.
    109108 *
    110  * Converts psTime to Julian date (JD) time. This function assumes the input time already is in TAI time and
    111  * does not add or subtract leapseconds.
     109 *  Converts psTime to Julian date (JD) time. This function assumes the input
     110 *  time already is in TAI time and does not add or subtract leapseconds.
    112111 *
    113112 *  @return  double: Julian Date (JD) time.
    114113 */
    115 
    116 double psTimeToJD(psTime time
    117                   /** Input time to be converted. */
    118                  );
     114double psTimeToJD(
     115    psTime time                        ///< Input time to be converted.
     116);
    119117
    120118/** Convert psTime to timeval time.
    121119 *
    122  * Converts psTime to timeval time. This function assumes the input time already is in TAI time and does not
    123  * add or subtract leapseconds.
     120 *  Converts psTime to timeval time. This function assumes the input time
     121 *  already is in TAI time and does not add or subtract leapseconds.
    124122 *
    125123 *  @return  timeval: timeval struct time.
    126124 */
    127 
    128 struct timeval psTimeToTimeval(psTime time
    129                                            /** Input time to be converted. */
    130                                           );
     125struct timeval psTimeToTimeval(
     126                psTime time                        ///< Input time to be converted.
     127            );
    131128
    132129/** Convert psTime to tm time.
     
    137134 *  @return  tm: tm struct time.
    138135 */
    139 
    140 struct tm *psTimeToTM(psTime time
    141                                   /** Input time to be converted. */
    142                                  );
     136struct tm *psTimeToTM(
     137                psTime time                        ///< Input time to be converted.
     138            );
    143139
    144140/** Convert ISO to psTime.
    145141 *
    146  * Converts ISO time to psTime. This function assumes the input time already is in TAI time and does not add
    147  * or subtract leapseconds.
     142 *  Converts ISO time to psTime. This function assumes the input time already
     143 *  is in TAI time and does not add or subtract leapseconds.
    148144 *
    149145 *  @return  psTime: time
    150146 */
    151 
    152 psTime psISOToTime(char *time
    153                    /** Input time to be converted. */
    154                   );
     147psTime psISOToTime(
     148    char *time                         ///< Input time to be converted.
     149);
    155150
    156151/** Convert UTC to psTime.
    157152 *
    158  * Converts UTC time to psTime. This function assumes the input time already is in TAI time and add or
    159  * subtracts the necessary leapseconds.
     153 *  Converts UTC time to psTime. This function assumes the input time already
     154 *  is in TAI time and add or subtracts the necessary leapseconds.
    160155 *
    161156 *  @return  psTime: time in TAI units.
    162157 */
    163 
    164 psTime psUTCToTime(psTime time
    165                    /** Input time to be converted. */
    166                   );
     158psTime psUTCToTime(
     159    psTime time                        ///< Input time to be converted.
     160);
    167161
    168162/** Convert MJD to psTime.
    169163 *
    170  * Converts MJD time to psTime. This function assumes the input time already is in TAI time and does not add
    171  * or subtract leapseconds.
    172  *
    173  *  @return  psTime: time.
    174  */
    175 
    176 psTime psMJDToTime(double time
    177                    /** Input time to be converted. */
    178                   );
     164 *  Converts MJD time to psTime. This function assumes the input time already
     165 *  is in TAI time and does not add or subtract leapseconds.
     166 *
     167 *  @return  psTime: time.
     168 */
     169psTime psMJDToTime(
     170    double time                        ///< Input time to be converted.
     171);
    179172
    180173/** Convert JD to psTime.
    181174 *
    182  * Converts JD time to psTime. This function assumes the input time already is in TAI time and does not add
    183  * or subtract leapseconds.
    184  *
    185  *  @return  psTime: time.
    186  */
    187 
    188 psTime psJDToTime(double time
    189                   /** Input time to be converted. */
    190                  );
     175 *  Converts JD time to psTime. This function assumes the input time already
     176 *  is in TAI time and does not add or subtract leapseconds.
     177 *
     178 *  @return  psTime: time.
     179 */
     180psTime psJDToTime(
     181    double time                        ///< Input time to be converted.
     182);
    191183
    192184/** Convert timeval to psTime.
    193185 *
    194  * Converts timeval time to psTime. This function assumes the input time already is in TAI time and does not
    195  * add or subtract leapseconds.
    196  *
    197  *  @return  psTime: time.
    198  */
    199 
    200 psTime psTimevalToTime(struct timeval *time
    201                        /** Input time to be converted. */
    202                       );
     186 *  Converts timeval time to psTime. This function assumes the input time
     187 *  already is in TAI time and does not add or subtract leapseconds.
     188 *
     189 *  @return  psTime: time.
     190 */
     191psTime psTimevalToTime(
     192    struct timeval *time               ///< Input time to be converted.
     193);
    203194
    204195/** Convert tm time to psTime.
    205196 *
    206  * Converts tm time to psTime. This function assumes the input time already is in TAI time and does not add
    207  * or subtract leapseconds.
    208  *
    209  *  @return  psTime: time.
    210  */
    211 
    212 psTime psTMToTime(struct tm *time
    213                   /** Input time to be converted. */
    214                  );
     197 *  Converts tm time to psTime. This function assumes the input time already
     198 *  is in TAI time and does not add or subtract leapseconds.
     199 *
     200 *  @return  psTime: time.
     201 */
     202psTime psTMToTime(
     203    struct tm *time                    ///< Input time to be converted.
     204);
    215205
    216206/// @}
  • trunk/psLib/src/collections/psMetadata.h

    r1441 r1496  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:54 $
     13*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-12 01:23:20 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434 */
    3535typedef enum {
    36     PS_META_ITEM_SET = 0,       ///< Null. Metadata is in psMetadataItem.items
    37     PS_META_BOOL,                          ///< Boolean data.
    38     PS_META_S32,                           ///< Signed 32-bit integer data.
    39     PS_META_F32,                           ///< Single-precision float data.
    40     PS_META_F64,                           ///< Double-precision float data.
    41     PS_META_STR,                           ///< String data (Stored in as void *).
    42     PS_META_IMG,                           ///< Image data (Stored in as void *).
    43     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    44     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    45     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    46     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
    47     PS_META_NTYPE                          ///< Number of types. Must be last.
     36    PS_META_ITEM_SET = 0,              ///< Null. Metadata is in psMetadataItem.items
     37    PS_META_BOOL,                      ///< Boolean data.
     38    PS_META_S32,                       ///< Signed 32-bit integer data.
     39    PS_META_F32,                       ///< Single-precision float data.
     40    PS_META_F64,                       ///< Double-precision float data.
     41    PS_META_STR,                       ///< String data (Stored in as void *).
     42    PS_META_IMG,                       ///< Image data (Stored in as void *).
     43    PS_META_JPEG,                      ///< JPEG data (Stored in as void *).
     44    PS_META_PNG,                       ///< PNG data (Stored in as void *).
     45    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as void *).
     46    PS_META_UNKNOWN,                   ///< Other data (Stored in as void *).
     47    PS_META_NTYPE                      ///< Number of types. Must be last.
    4848} psMetadataType;
    4949
     
    5555typedef struct psMetadataItem
    5656{
    57     const int id;               ///< Unique ID for metadata item.
    58     char *restrict name;        ///< Name of metadata item.
    59     psMetadataType type;        ///< Type of metadata item.
     57    const int id;                      ///< Unique ID for metadata item.
     58    char *restrict name;               ///< Name of metadata item.
     59    psMetadataType type;               ///< Type of metadata item.
    6060    union {
    61         bool B;
    62         psS32 S32;              ///< Signed 32-bit integer data.
    63         psF32 F32;              ///< Single-precision float data.
    64         psF64 F64;              ///< Double-precision float data.
    65         psPTR V;                ///< Pointer to other type of data.
    66     } data;                     ///< Union for data types.
    67     char *comment;              ///< Optional comment ("", not NULL).
    68     psList* restrict items;     ///< List of psMetadataItems with same name.
     61        bool B;                        ///< boolean data
     62        psS32 S32;                     ///< Signed 32-bit integer data.
     63        psF32 F32;                     ///< Single-precision float data.
     64        psF64 F64;                     ///< Double-precision float data.
     65        psPTR V;                       ///< Pointer to other type of data.
     66    } data;                            ///< Union for data types.
     67    char *comment;                     ///< Optional comment ("", not NULL).
     68    psList* restrict items;            ///< List of psMetadataItems with same name.
    6969}
    7070psMetadataItem;
     
    7272/** Metadata data structure.
    7373 *
    74  * Struct for holding metadata items. Metadata items are held in two containers. The first employs a
    75  * doubly-linked list to preserve the order of the metadata. The second container employs a hash table which
    76  * allows fast lookup when given a metadata keyword.
     74 *  Struct for holding metadata items. Metadata items are held in two
     75 *  containers. The first employs a doubly-linked list to preserve the order
     76 *  of the metadata. The second container employs a hash table which
     77 *  allows fast lookup when given a metadata keyword.
    7778 */
    7879typedef struct psMetadata
    7980{
    80     psList* restrict list;
    81     psHash* restrict table;
     81    psList* restrict list;             ///< the metadata in linked-list
     82    psHash* restrict table;            ///< the metadata in a hash table
    8283}
    8384psMetadata;
     
    9192/** Create a metadata item.
    9293 *
    93  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    94  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    95  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    96  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    97  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    98  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    99  * by the va_list operators in the function.
    100  * specified size and type.
    101  *
    102  * @return psMetadataItem* : Pointer metadata item.
    103  */
    104 psMetadataItem* psMetadataItemAlloc(const char *name,   ///< Name of metadata item.
    105                                     psMetadataType type,        ///< Type of metadata item.
    106                                     const char *comment,        ///< Comment for metadata item.
    107                                     ... ///< Arguments for name formatting and metadata item data.
    108                                    );
     94 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     95 *  struct. The name argument specifies the name to use for this item, and
     96 *  may include sprintf formatting codes. The format entry specifies both
     97 *  the metadata type and optional flags and is created by bit-wise or of the
     98 *  appropriate type and flag. The comment argument is a fixed string used to
     99 *  comment the metadata item. The arguments to the name formatting codes and
     100 *  the metadata itself are passed as arguments following the comment string.
     101 *  The data must be a pointer for any of the elements stored in data.void.
     102 *  The argument list must be interpreted appropriately by the va_list
     103 *  operators in the function specified size and type.
     104 *
     105 * @return psMetadataItem* : Pointer metadata item.
     106 */
     107psMetadataItem* psMetadataItemAlloc(
     108    const char *name,                  ///< Name of metadata item.
     109    psMetadataType type,               ///< Type of metadata item.
     110    const char *comment,               ///< Comment for metadata item.
     111    ...                                ///< Arguments for name formatting and metadata item data.
     112);
    109113
    110114/** Create a metadata item with va_list.
    111115 *
    112  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    113  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    114  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    115  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    116  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    117  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    118  * by the va_list operators in the function.
    119  * specified size and type.
    120  *
    121  * @return psMetadataItem* : Pointer metadata item.
    122  */
    123 psMetadataItem* psMetadataItemAllocV(const char *name,  ///< Name of metadata item.
    124                                      psMetadataType type,       ///< Type of metadata item.
    125                                      const char *comment,       ///< Comment for metadata item.
    126                                      va_list list       ///< Arguments for name formatting and metadata item
    127                                      // data.
    128                                     );
     116 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     117 *  struct. The name argument specifies the name to use for this item, and
     118 *  may include sprintf formatting codes. The format entry specifies both
     119 *  the metadata type and optional flags and is created by bit-wise or of the
     120 *  appropriate type and flag. The comment argument is a fixed string used to
     121 *  comment the metadata item. The arguments to the name formatting codes and
     122 *  the metadata itself are passed as arguments following the comment string.
     123 *  The data must be a pointer for any of the elements stored in data.void.
     124 *  The argument list must be interpreted appropriately by the va_list
     125 *  operators in the function specified size and type.
     126 *
     127 * @return psMetadataItem* : Pointer metadata item.
     128 */
     129psMetadataItem* psMetadataItemAllocV(
     130    const char *name,                  ///< Name of metadata item.
     131    psMetadataType type,               ///< Type of metadata item.
     132    const char *comment,               ///< Comment for metadata item.
     133    va_list list                       ///< Arguments for name formatting and metadata item data.
     134);
    129135
    130136/** Create a metadata collection.
    131137 *
    132  * Returns an empty metadata container with fully allocated internal metadata containers.
    133  *
    134  * @return psMetadata* : Pointer metadata.
    135  */
    136 psMetadata* psMetadataAlloc(void        ///< Void.
    137                            );
     138 *  Returns an empty metadata container with fully allocated internal metadata
     139 *  containers.
     140 *
     141 *  @return psMetadata* : Pointer metadata.
     142 */
     143psMetadata* psMetadataAlloc(void);
    138144
    139145/** Add existing metadata item to metadata collection.
    140146 *
    141  * Add a metadata item that has already been created to the metadata collection.
     147 *  Add a metadata item that has already been created to the metadata
     148 *  collection.
     149 *
     150 *  @return bool: True for success, false for failure.
     151 */
     152bool psMetadataAddItem(
     153    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     154    int where,                         ///< Location to be added.
     155    psMetadataItem* restrict item      ///< Metadata item to be added.
     156);
     157
     158/** Create and add a metadata item to metadata collection.
     159 *
     160 * Creates a new metadata item add to the metadata collection.
    142161 *
    143162 * @return bool: True for success, false for failure.
    144163 */
    145 bool psMetadataAddItem(psMetadata* restrict md,        ///< Metadata collection to insert metadat item.
    146                        int where,       ///< Location to be added.
    147                        psMetadataItem* restrict item   ///< Metadata item to be added.
    148                       );
    149 
    150 /** Create and add a metadata item to metadata collection.
    151  *
    152  * Creates a new metadata item add to the metadata collection.
     164bool psMetadataAdd(
     165    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     166    int where,                         ///< Location to be added.
     167    const char *name,                  ///< Name of metadata item.
     168    psMetadataType type,               ///< Type of metadata item.
     169    const char *comment,               ///< Comment for metadata item.
     170    ...                                ///< Arguments for name formatting and metadata item data.
     171);
     172
     173/** Remove an item from metadata collection.
     174 *
     175 *  Items may be removed from metadata by specifing a key or location. If the
     176 *  name is null, the where argument is used instead. If name is not null,
     177 *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
     178 *  the metadata and true is returned.  If the key is not unique, then all
     179 *  items corresponding to it are removed.
    153180 *
    154181 * @return bool: True for success, false for failure.
    155182 */
    156 bool psMetadataAdd(psMetadata* restrict md,    ///< Metadata collection to insert metadat item.
    157                    int where,   ///< Location to be added.
    158                    const char *name,    ///< Name of metadata item.
    159                    psMetadataType type, ///< Type of metadata item.
    160                    const char *comment, ///< Comment for metadata item.
    161                    ...          ///< Arguments for name formatting and metadata item data.
    162                   );
    163 
    164 /** Remove an item from metadata collection.
    165  *
    166  * Items may be removed from metadata by specifing a key or location. If the name is null, the where argument
    167  * is used instead. If name is not null, where is set to PS_LIST_UNKNOWN. If the item is found, it is removed
    168  * from the metadata and true is returned.  If the key is not unique, then all items corresponding to it are
    169  * removed.
    170  *
    171  * @return bool: True for success, false for failure.
    172  */
    173 bool psMetadataRemove(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    174                       int where,        ///< Location to be removed.
    175                       const char *restrict key  ///< Name of metadata key.
    176                      );
     183bool psMetadataRemove(
     184    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     185    int where,                         ///< Location to be removed.
     186    const char *restrict key           ///< Name of metadata key.
     187);
    177188
    178189/** Find an item in the metadata collection based on key name.
    179190 *
    180  * Items may be found in the metadata by providing a key. If the key is non-unique, the first item is
    181  * returned. If the item is not found, null is returned.
    182  *
    183  * @return psMetadataItem* : Pointer metadata item.
    184  */
    185 psMetadataItem* psMetadataLookup(psMetadata* restrict md,      ///< Metadata collection to insert metadat
    186                                  // item.
    187                                  const char *restrict key       ///< Name of metadata key.
    188                                 );
     191 *  Items may be found in the metadata by providing a key. If the key is
     192 *  non-unique, the first item is returned. If the item is not found, null is
     193 *  returned.
     194 *
     195 * @return psMetadataItem* : Pointer metadata item.
     196 */
     197psMetadataItem* psMetadataLookup(
     198    psMetadata* restrict md,           ///< Metadata collection to insert metadata item.
     199    const char *restrict key           ///< Name of metadata key.
     200);
    189201
    190202/** Find an item in the metadata collection based on list index.
    191203 *
    192  * Items may be found in the metadata by their entry position in the list container.
    193  *
    194  * @return psMetadataItem* : Pointer metadata item.
    195  */
    196 psMetadataItem* psMetadataGet(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    197                               int where ///< Location to be retrieved.
    198                              );
     204 *  Items may be found in the metadata by their entry position in the list
     205 *  container.
     206 *
     207 *  @return psMetadataItem* : Pointer metadata item.
     208 */
     209psMetadataItem* psMetadataGet(
     210    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     211    int where                          ///< Location to be retrieved.
     212);
    199213
    200214/** Set or reset metadata iterator.
    201215 *
    202  * Metadata may be iterated by setting or resetting an iterator to a location in the metadata list.
     216 *  Metadata may be iterated by setting or resetting an iterator to a location
     217 *  in the metadata list.
    203218 *
    204219 * @return void: void.
    205220 */
    206 bool psMetadataSetIterator(psMetadata* restrict md,    ///< Metadata collection to iterate.
    207                            int where    ///< Location of iterator.
    208                           );
     221bool psMetadataSetIterator(
     222    psMetadata* restrict md,           ///< Metadata collection to iterate.
     223    int where                          ///< Location of iterator.
     224);
    209225
    210226/** Get next metadata item.
     
    214230 * @return psMetadataItem* : Pointer metadata item.
    215231 */
    216 psMetadataItem* psMetadataGetNext(psMetadata* restrict md,     ///< Metadata collection to iterate.
    217                                   const char *restrict match,   ///< Beginning of key name.
    218                                   int which     ///< Iterator to be used.
    219                                  );
     232psMetadataItem* psMetadataGetNext(
     233    psMetadata* restrict md,           ///< Metadata collection to iterate.
     234    const char *restrict match,        ///< Beginning of key name.
     235    int which                          ///< Iterator to be used.
     236);
    220237
    221238/** Get previous metadata item.
     
    225242 * @return psMetadataItem* : Pointer metadata item.
    226243 */
    227 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, ///< Metadata collection to iterate.
    228                                       const char *restrict match,       ///< Beginning of key name.
    229                                       int which ///< Iterator to be used.
    230                                      );
     244psMetadataItem* psMetadataGetPrevious(
     245    psMetadata* restrict md,           ///< Metadata collection to iterate.
     246    const char *restrict match,        ///< Beginning of key name.
     247    int which                          ///< Iterator to be used.
     248);
    231249
    232250/** Print metadata item to file.
    233251 *
    234  * Metadata items may be printed to an open file descriptor based on a provided format. The format is a
    235  * sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric
    236  * type, this formatting command must also be numeric, and the type conversion performed to the value to match
    237  * the format type. If the metadata type is a string, the fromatting command must also be for a string. If the
    238  * metadata type is any other data type, printing is not allowed.
    239  *
    240  * @return psMetadataItem* : Pointer metadata item.
    241  */
    242 void psMetadataItemPrint(FILE * fd,     ///< Pointer to file to write metadata item.
    243                          const char *format,    ///< Format to print metadata item.
    244                          const psMetadataItem* restrict metadataItem   ///< Metadata item to print.
    245                         );
     252 *  Metadata items may be printed to an open file descriptor based on a
     253 *  provided format. The format is a sprintf format statement with exactly
     254 *  one % formatting command. If the metadata item type is a numeric type,
     255 *  this formatting command must also be numeric, and the type conversion
     256 *  performed to the value to match the format type. If the metadata type is
     257 *  a string, the fromatting command must also be for a string. If the
     258 *  metadata type is any other data type, printing is not allowed.
     259 *
     260 * @return psMetadataItem* : Pointer metadata item.
     261 */
     262void psMetadataItemPrint(
     263    FILE * fd,                         ///< Pointer to file to write metadata item.
     264    const char *format,                ///< Format to print metadata item.
     265    const psMetadataItem* restrict metadataItem ///< Metadata item to print.
     266);
    246267
    247268/** Read metadata header.
    248269 *
    249  * Read a metadata header from file. If the file is not found, an error is reported. This file is currently
    250  * unimplemented.
    251  *
    252  * @return psMetadata* : Pointer metadata.
    253  */
    254 psMetadata* psMetadataReadHeader(psMetadata* output,   ///< Resulting metadata from read.
    255                                  char *extname, ///< File name extension string.
    256                                  int extnum,    ///< File name extension number. Starts at 1.
    257                                  char *filename ///< Name of file to read.
    258                                 );
     270 *  Read a metadata header from file. If the file is not found, an error is
     271 *  reported. This file is currently unimplemented.
     272 *
     273 *  @return psMetadata* : Pointer metadata.
     274 */
     275psMetadata* psMetadataReadHeader(
     276    psMetadata* output,                ///< Resulting metadata from read.
     277    char *extname,                     ///< File name extension string.
     278    int extnum,                        ///< File name extension number. Starts at 1.
     279    char *filename                     ///< Name of file to read.
     280);
    259281
    260282/** Read metadata header.
    261283 *
    262  * Read a metadata header from file. If the file is not found, an error is reported.
    263  *
    264  * @return psMetadata* : Pointer metadata.
    265  */
    266 psMetadata* psMetadataFReadHeader(psMetadata* output,  ///< Resulting metadata from read.
    267                                   char *extName,        ///< File name extension string.
    268                                   int extNum,   ///< File name extension number.
    269                                   fitsfile * fd ///< Pointer to file to read.
    270                                  );
     284 *  Read a metadata header from file. If the file is not found, an error is
     285 *  reported.
     286 *
     287 *  @return psMetadata* : Pointer metadata.
     288 */
     289psMetadata* psMetadataFReadHeader(
     290    psMetadata* output,                ///< Resulting metadata from read.
     291    char *extName,                     ///< File name extension string.
     292    int extNum,                        ///< File name extension number.
     293    fitsfile * fd                      ///< Pointer to file to read.
     294);
    271295
    272296/// @}
  • trunk/psLib/src/types/psMetadata.h

    r1441 r1496  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:54 $
     13*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-12 01:23:20 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434 */
    3535typedef enum {
    36     PS_META_ITEM_SET = 0,       ///< Null. Metadata is in psMetadataItem.items
    37     PS_META_BOOL,                          ///< Boolean data.
    38     PS_META_S32,                           ///< Signed 32-bit integer data.
    39     PS_META_F32,                           ///< Single-precision float data.
    40     PS_META_F64,                           ///< Double-precision float data.
    41     PS_META_STR,                           ///< String data (Stored in as void *).
    42     PS_META_IMG,                           ///< Image data (Stored in as void *).
    43     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    44     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    45     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    46     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
    47     PS_META_NTYPE                          ///< Number of types. Must be last.
     36    PS_META_ITEM_SET = 0,              ///< Null. Metadata is in psMetadataItem.items
     37    PS_META_BOOL,                      ///< Boolean data.
     38    PS_META_S32,                       ///< Signed 32-bit integer data.
     39    PS_META_F32,                       ///< Single-precision float data.
     40    PS_META_F64,                       ///< Double-precision float data.
     41    PS_META_STR,                       ///< String data (Stored in as void *).
     42    PS_META_IMG,                       ///< Image data (Stored in as void *).
     43    PS_META_JPEG,                      ///< JPEG data (Stored in as void *).
     44    PS_META_PNG,                       ///< PNG data (Stored in as void *).
     45    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as void *).
     46    PS_META_UNKNOWN,                   ///< Other data (Stored in as void *).
     47    PS_META_NTYPE                      ///< Number of types. Must be last.
    4848} psMetadataType;
    4949
     
    5555typedef struct psMetadataItem
    5656{
    57     const int id;               ///< Unique ID for metadata item.
    58     char *restrict name;        ///< Name of metadata item.
    59     psMetadataType type;        ///< Type of metadata item.
     57    const int id;                      ///< Unique ID for metadata item.
     58    char *restrict name;               ///< Name of metadata item.
     59    psMetadataType type;               ///< Type of metadata item.
    6060    union {
    61         bool B;
    62         psS32 S32;              ///< Signed 32-bit integer data.
    63         psF32 F32;              ///< Single-precision float data.
    64         psF64 F64;              ///< Double-precision float data.
    65         psPTR V;                ///< Pointer to other type of data.
    66     } data;                     ///< Union for data types.
    67     char *comment;              ///< Optional comment ("", not NULL).
    68     psList* restrict items;     ///< List of psMetadataItems with same name.
     61        bool B;                        ///< boolean data
     62        psS32 S32;                     ///< Signed 32-bit integer data.
     63        psF32 F32;                     ///< Single-precision float data.
     64        psF64 F64;                     ///< Double-precision float data.
     65        psPTR V;                       ///< Pointer to other type of data.
     66    } data;                            ///< Union for data types.
     67    char *comment;                     ///< Optional comment ("", not NULL).
     68    psList* restrict items;            ///< List of psMetadataItems with same name.
    6969}
    7070psMetadataItem;
     
    7272/** Metadata data structure.
    7373 *
    74  * Struct for holding metadata items. Metadata items are held in two containers. The first employs a
    75  * doubly-linked list to preserve the order of the metadata. The second container employs a hash table which
    76  * allows fast lookup when given a metadata keyword.
     74 *  Struct for holding metadata items. Metadata items are held in two
     75 *  containers. The first employs a doubly-linked list to preserve the order
     76 *  of the metadata. The second container employs a hash table which
     77 *  allows fast lookup when given a metadata keyword.
    7778 */
    7879typedef struct psMetadata
    7980{
    80     psList* restrict list;
    81     psHash* restrict table;
     81    psList* restrict list;             ///< the metadata in linked-list
     82    psHash* restrict table;            ///< the metadata in a hash table
    8283}
    8384psMetadata;
     
    9192/** Create a metadata item.
    9293 *
    93  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    94  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    95  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    96  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    97  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    98  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    99  * by the va_list operators in the function.
    100  * specified size and type.
    101  *
    102  * @return psMetadataItem* : Pointer metadata item.
    103  */
    104 psMetadataItem* psMetadataItemAlloc(const char *name,   ///< Name of metadata item.
    105                                     psMetadataType type,        ///< Type of metadata item.
    106                                     const char *comment,        ///< Comment for metadata item.
    107                                     ... ///< Arguments for name formatting and metadata item data.
    108                                    );
     94 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     95 *  struct. The name argument specifies the name to use for this item, and
     96 *  may include sprintf formatting codes. The format entry specifies both
     97 *  the metadata type and optional flags and is created by bit-wise or of the
     98 *  appropriate type and flag. The comment argument is a fixed string used to
     99 *  comment the metadata item. The arguments to the name formatting codes and
     100 *  the metadata itself are passed as arguments following the comment string.
     101 *  The data must be a pointer for any of the elements stored in data.void.
     102 *  The argument list must be interpreted appropriately by the va_list
     103 *  operators in the function specified size and type.
     104 *
     105 * @return psMetadataItem* : Pointer metadata item.
     106 */
     107psMetadataItem* psMetadataItemAlloc(
     108    const char *name,                  ///< Name of metadata item.
     109    psMetadataType type,               ///< Type of metadata item.
     110    const char *comment,               ///< Comment for metadata item.
     111    ...                                ///< Arguments for name formatting and metadata item data.
     112);
    109113
    110114/** Create a metadata item with va_list.
    111115 *
    112  * Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies
    113  * the name to use for this item, and may include sprintf formatting codes. The format entry specifies both
    114  * the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The
    115  * comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting
    116  * codes and the metadata itself are passed as arguments following the comment string. The data must be
    117  * a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately
    118  * by the va_list operators in the function.
    119  * specified size and type.
    120  *
    121  * @return psMetadataItem* : Pointer metadata item.
    122  */
    123 psMetadataItem* psMetadataItemAllocV(const char *name,  ///< Name of metadata item.
    124                                      psMetadataType type,       ///< Type of metadata item.
    125                                      const char *comment,       ///< Comment for metadata item.
    126                                      va_list list       ///< Arguments for name formatting and metadata item
    127                                      // data.
    128                                     );
     116 *  Returns a fill psMetadataItem ready for insertion into the psMetadata
     117 *  struct. The name argument specifies the name to use for this item, and
     118 *  may include sprintf formatting codes. The format entry specifies both
     119 *  the metadata type and optional flags and is created by bit-wise or of the
     120 *  appropriate type and flag. The comment argument is a fixed string used to
     121 *  comment the metadata item. The arguments to the name formatting codes and
     122 *  the metadata itself are passed as arguments following the comment string.
     123 *  The data must be a pointer for any of the elements stored in data.void.
     124 *  The argument list must be interpreted appropriately by the va_list
     125 *  operators in the function specified size and type.
     126 *
     127 * @return psMetadataItem* : Pointer metadata item.
     128 */
     129psMetadataItem* psMetadataItemAllocV(
     130    const char *name,                  ///< Name of metadata item.
     131    psMetadataType type,               ///< Type of metadata item.
     132    const char *comment,               ///< Comment for metadata item.
     133    va_list list                       ///< Arguments for name formatting and metadata item data.
     134);
    129135
    130136/** Create a metadata collection.
    131137 *
    132  * Returns an empty metadata container with fully allocated internal metadata containers.
    133  *
    134  * @return psMetadata* : Pointer metadata.
    135  */
    136 psMetadata* psMetadataAlloc(void        ///< Void.
    137                            );
     138 *  Returns an empty metadata container with fully allocated internal metadata
     139 *  containers.
     140 *
     141 *  @return psMetadata* : Pointer metadata.
     142 */
     143psMetadata* psMetadataAlloc(void);
    138144
    139145/** Add existing metadata item to metadata collection.
    140146 *
    141  * Add a metadata item that has already been created to the metadata collection.
     147 *  Add a metadata item that has already been created to the metadata
     148 *  collection.
     149 *
     150 *  @return bool: True for success, false for failure.
     151 */
     152bool psMetadataAddItem(
     153    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     154    int where,                         ///< Location to be added.
     155    psMetadataItem* restrict item      ///< Metadata item to be added.
     156);
     157
     158/** Create and add a metadata item to metadata collection.
     159 *
     160 * Creates a new metadata item add to the metadata collection.
    142161 *
    143162 * @return bool: True for success, false for failure.
    144163 */
    145 bool psMetadataAddItem(psMetadata* restrict md,        ///< Metadata collection to insert metadat item.
    146                        int where,       ///< Location to be added.
    147                        psMetadataItem* restrict item   ///< Metadata item to be added.
    148                       );
    149 
    150 /** Create and add a metadata item to metadata collection.
    151  *
    152  * Creates a new metadata item add to the metadata collection.
     164bool psMetadataAdd(
     165    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     166    int where,                         ///< Location to be added.
     167    const char *name,                  ///< Name of metadata item.
     168    psMetadataType type,               ///< Type of metadata item.
     169    const char *comment,               ///< Comment for metadata item.
     170    ...                                ///< Arguments for name formatting and metadata item data.
     171);
     172
     173/** Remove an item from metadata collection.
     174 *
     175 *  Items may be removed from metadata by specifing a key or location. If the
     176 *  name is null, the where argument is used instead. If name is not null,
     177 *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
     178 *  the metadata and true is returned.  If the key is not unique, then all
     179 *  items corresponding to it are removed.
    153180 *
    154181 * @return bool: True for success, false for failure.
    155182 */
    156 bool psMetadataAdd(psMetadata* restrict md,    ///< Metadata collection to insert metadat item.
    157                    int where,   ///< Location to be added.
    158                    const char *name,    ///< Name of metadata item.
    159                    psMetadataType type, ///< Type of metadata item.
    160                    const char *comment, ///< Comment for metadata item.
    161                    ...          ///< Arguments for name formatting and metadata item data.
    162                   );
    163 
    164 /** Remove an item from metadata collection.
    165  *
    166  * Items may be removed from metadata by specifing a key or location. If the name is null, the where argument
    167  * is used instead. If name is not null, where is set to PS_LIST_UNKNOWN. If the item is found, it is removed
    168  * from the metadata and true is returned.  If the key is not unique, then all items corresponding to it are
    169  * removed.
    170  *
    171  * @return bool: True for success, false for failure.
    172  */
    173 bool psMetadataRemove(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    174                       int where,        ///< Location to be removed.
    175                       const char *restrict key  ///< Name of metadata key.
    176                      );
     183bool psMetadataRemove(
     184    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     185    int where,                         ///< Location to be removed.
     186    const char *restrict key           ///< Name of metadata key.
     187);
    177188
    178189/** Find an item in the metadata collection based on key name.
    179190 *
    180  * Items may be found in the metadata by providing a key. If the key is non-unique, the first item is
    181  * returned. If the item is not found, null is returned.
    182  *
    183  * @return psMetadataItem* : Pointer metadata item.
    184  */
    185 psMetadataItem* psMetadataLookup(psMetadata* restrict md,      ///< Metadata collection to insert metadat
    186                                  // item.
    187                                  const char *restrict key       ///< Name of metadata key.
    188                                 );
     191 *  Items may be found in the metadata by providing a key. If the key is
     192 *  non-unique, the first item is returned. If the item is not found, null is
     193 *  returned.
     194 *
     195 * @return psMetadataItem* : Pointer metadata item.
     196 */
     197psMetadataItem* psMetadataLookup(
     198    psMetadata* restrict md,           ///< Metadata collection to insert metadata item.
     199    const char *restrict key           ///< Name of metadata key.
     200);
    189201
    190202/** Find an item in the metadata collection based on list index.
    191203 *
    192  * Items may be found in the metadata by their entry position in the list container.
    193  *
    194  * @return psMetadataItem* : Pointer metadata item.
    195  */
    196 psMetadataItem* psMetadataGet(psMetadata* restrict md, ///< Metadata collection to insert metadat item.
    197                               int where ///< Location to be retrieved.
    198                              );
     204 *  Items may be found in the metadata by their entry position in the list
     205 *  container.
     206 *
     207 *  @return psMetadataItem* : Pointer metadata item.
     208 */
     209psMetadataItem* psMetadataGet(
     210    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     211    int where                          ///< Location to be retrieved.
     212);
    199213
    200214/** Set or reset metadata iterator.
    201215 *
    202  * Metadata may be iterated by setting or resetting an iterator to a location in the metadata list.
     216 *  Metadata may be iterated by setting or resetting an iterator to a location
     217 *  in the metadata list.
    203218 *
    204219 * @return void: void.
    205220 */
    206 bool psMetadataSetIterator(psMetadata* restrict md,    ///< Metadata collection to iterate.
    207                            int where    ///< Location of iterator.
    208                           );
     221bool psMetadataSetIterator(
     222    psMetadata* restrict md,           ///< Metadata collection to iterate.
     223    int where                          ///< Location of iterator.
     224);
    209225
    210226/** Get next metadata item.
     
    214230 * @return psMetadataItem* : Pointer metadata item.
    215231 */
    216 psMetadataItem* psMetadataGetNext(psMetadata* restrict md,     ///< Metadata collection to iterate.
    217                                   const char *restrict match,   ///< Beginning of key name.
    218                                   int which     ///< Iterator to be used.
    219                                  );
     232psMetadataItem* psMetadataGetNext(
     233    psMetadata* restrict md,           ///< Metadata collection to iterate.
     234    const char *restrict match,        ///< Beginning of key name.
     235    int which                          ///< Iterator to be used.
     236);
    220237
    221238/** Get previous metadata item.
     
    225242 * @return psMetadataItem* : Pointer metadata item.
    226243 */
    227 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, ///< Metadata collection to iterate.
    228                                       const char *restrict match,       ///< Beginning of key name.
    229                                       int which ///< Iterator to be used.
    230                                      );
     244psMetadataItem* psMetadataGetPrevious(
     245    psMetadata* restrict md,           ///< Metadata collection to iterate.
     246    const char *restrict match,        ///< Beginning of key name.
     247    int which                          ///< Iterator to be used.
     248);
    231249
    232250/** Print metadata item to file.
    233251 *
    234  * Metadata items may be printed to an open file descriptor based on a provided format. The format is a
    235  * sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric
    236  * type, this formatting command must also be numeric, and the type conversion performed to the value to match
    237  * the format type. If the metadata type is a string, the fromatting command must also be for a string. If the
    238  * metadata type is any other data type, printing is not allowed.
    239  *
    240  * @return psMetadataItem* : Pointer metadata item.
    241  */
    242 void psMetadataItemPrint(FILE * fd,     ///< Pointer to file to write metadata item.
    243                          const char *format,    ///< Format to print metadata item.
    244                          const psMetadataItem* restrict metadataItem   ///< Metadata item to print.
    245                         );
     252 *  Metadata items may be printed to an open file descriptor based on a
     253 *  provided format. The format is a sprintf format statement with exactly
     254 *  one % formatting command. If the metadata item type is a numeric type,
     255 *  this formatting command must also be numeric, and the type conversion
     256 *  performed to the value to match the format type. If the metadata type is
     257 *  a string, the fromatting command must also be for a string. If the
     258 *  metadata type is any other data type, printing is not allowed.
     259 *
     260 * @return psMetadataItem* : Pointer metadata item.
     261 */
     262void psMetadataItemPrint(
     263    FILE * fd,                         ///< Pointer to file to write metadata item.
     264    const char *format,                ///< Format to print metadata item.
     265    const psMetadataItem* restrict metadataItem ///< Metadata item to print.
     266);
    246267
    247268/** Read metadata header.
    248269 *
    249  * Read a metadata header from file. If the file is not found, an error is reported. This file is currently
    250  * unimplemented.
    251  *
    252  * @return psMetadata* : Pointer metadata.
    253  */
    254 psMetadata* psMetadataReadHeader(psMetadata* output,   ///< Resulting metadata from read.
    255                                  char *extname, ///< File name extension string.
    256                                  int extnum,    ///< File name extension number. Starts at 1.
    257                                  char *filename ///< Name of file to read.
    258                                 );
     270 *  Read a metadata header from file. If the file is not found, an error is
     271 *  reported. This file is currently unimplemented.
     272 *
     273 *  @return psMetadata* : Pointer metadata.
     274 */
     275psMetadata* psMetadataReadHeader(
     276    psMetadata* output,                ///< Resulting metadata from read.
     277    char *extname,                     ///< File name extension string.
     278    int extnum,                        ///< File name extension number. Starts at 1.
     279    char *filename                     ///< Name of file to read.
     280);
    259281
    260282/** Read metadata header.
    261283 *
    262  * Read a metadata header from file. If the file is not found, an error is reported.
    263  *
    264  * @return psMetadata* : Pointer metadata.
    265  */
    266 psMetadata* psMetadataFReadHeader(psMetadata* output,  ///< Resulting metadata from read.
    267                                   char *extName,        ///< File name extension string.
    268                                   int extNum,   ///< File name extension number.
    269                                   fitsfile * fd ///< Pointer to file to read.
    270                                  );
     284 *  Read a metadata header from file. If the file is not found, an error is
     285 *  reported.
     286 *
     287 *  @return psMetadata* : Pointer metadata.
     288 */
     289psMetadata* psMetadataFReadHeader(
     290    psMetadata* output,                ///< Resulting metadata from read.
     291    char *extName,                     ///< File name extension string.
     292    int extNum,                        ///< File name extension number.
     293    fitsfile * fd                      ///< Pointer to file to read.
     294);
    271295
    272296/// @}
Note: See TracChangeset for help on using the changeset viewer.