IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1382


Ignore:
Timestamp:
Aug 4, 2004, 12:11:09 PM (22 years ago)
Author:
desonia
Message:

merged psAstrometry and psCCD, which had recursive header dependencies; yuk!
Also added required includes in other files to allow psAstrometry.h to
work without having to know which other include files are needed before
including a particular header file.

Location:
trunk/psLib/src
Files:
4 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/Makefile

    r1338 r1382  
    99SRC_OBJS = psTime.o \
    1010           psMetadata.o \
    11            psCCD.o \
    1211           psCoord.o
     12#           psAstrometry.o             George, this is crap code!
    1313
    1414OBJS = $(addprefix makedir/,$(SRC_OBJS))
  • trunk/psLib/src/astronomy/psAstrometry.c

    r1333 r1382  
    1 // This file contains
    2 
    3 #include "psType.h"
    4 #include "psImage.h"
    5 #include "psArray.h"
    6 #include "psList.h"
     1/** @file  psAstrometry.c
     2*
     3*  @brief This file defines the basic types for astronomical coordinate
     4*  transformation
     5*
     6*  @ingroup AstroImage
     7*
     8*  @author George Gusciora, MHPCC
     9*
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-04 22:11:09 $
     12*
     13*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     14*/
     15
     16#include<math.h>
     17
    718#include "psFunctions.h"
    8 
    9 psGrommit *psGrommitAlloc(const psExposure *exp)
    10 {
    11     double *slaGrommit = (double *) psAlloc(14 * sizeof(double));
    12     psGrommit *grommit = (psGrommit *) psAlloc(sizeof(psGrommit));
     19#include "psAstrometry.h"
     20#include "psMemory.h"
     21
     22void grommitFree( psGrommit *grommit );
     23int checkValidChipCoords( double x, double y, psChip *tmpChip );
     24int checkValidImageCoords( double x, double y, psImage *tmpImage );
     25
     26psExposure* psExposureAlloc( double ra, double dec, double hourAngle,
     27                             double zenith, double azimuth, double localTime, float date,
     28                             float rotAngle, float temperature, float pressure, float humidity,
     29                             float exposureTime )
     30{
     31    psExposure * exp = psAlloc( sizeof( psExposure ) );
     32   
     33    *( double* ) & exp->ra = ra;
     34    *( double* ) & exp->dec = dec;
     35    *( double* ) & exp->hourAngle = hourAngle;
     36    *( double* ) & exp->zenith = zenith;
     37    *( double* ) & exp->azimuth = azimuth;
     38    *( double* ) & exp->localTime = localTime;
     39    *( float* ) & exp->date = date;
     40    *( float* ) & exp->rotAngle = rotAngle;
     41    *( float* ) & exp->temperature = temperature;
     42    *( float* ) & exp->pressure = pressure;
     43    *( float* ) & exp->humidity = humidity;
     44    *( float* ) & exp->exposureTime = exposureTime;
     45   
     46    return exp;
     47   
     48}
     49
     50psGrommit* psGrommitAlloc( const psExposure *exp )
     51{
     52    double * slaGrommit = ( double * ) psAlloc( 14 * sizeof( double ) );
     53    psGrommit *grommit = ( psGrommit * ) psAlloc( sizeof( psGrommit ) );
    1354    /*
    1455        extern void sla_aoppa(double date,
     
    3071                  tlr);
    3172    */
    32     grommit->latitude = exp->dec;              // XXX Is this correct?
    33     grommit->sinLat = sin(grommit->latitude);
    34     grommit->cosLat = cos(grommit->latitude);
    35     grommit->abberationMag = 0.0;
    36     grommit->height = 0.0;
    37     grommit->temperature = exp->temperature;
    38     grommit->pressure = exp->pressure;
    39     grommit->humidity = exp->humidity;
    40     grommit->wavelength = 0.0;
    41     grommit->lapseRate = 0.0;
    42     grommit->refractA = 0.0;
    43     grommit->refractB = 0.0;
    44     grommit->longitudeOffset = ra;             // XXX Is this correct?
    45     grommit->siderealTime = 0.0;
    46 
    47     psFree(slaGrommit);
    48     return(grommit);
    49 }
    50 
    51 void p_psGrommitFree(psGrommit *grommit)
    52 {
    53     psFree(grommit);
    54 }
    55 
    56 psCell *psCellinFPA(psCell *out,
    57                     const psPlane *coord,
    58                     const psFPA *FPA)
    59 {
    60     psChip *tmpChip = NULL;
     73    *( double* ) & grommit->latitude = exp->dec;              // XXX Is this correct?
     74    *( double* ) & grommit->sinLat = sin( grommit->latitude );
     75    *( double* ) & grommit->cosLat = cos( grommit->latitude );
     76    *( double* ) & grommit->abberationMag = 0.0;
     77    *( double* ) & grommit->height = 0.0;
     78    *( double* ) & grommit->temperature = exp->temperature;
     79    *( double* ) & grommit->pressure = exp->pressure;
     80    *( double* ) & grommit->humidity = exp->humidity;
     81    *( double* ) & grommit->wavelength = 0.0;
     82    *( double* ) & grommit->lapseRate = 0.0;
     83    *( double* ) & grommit->refractA = 0.0;
     84    *( double* ) & grommit->refractB = 0.0;
     85    *( double* ) & grommit->longitudeOffset = exp->ra;             // XXX Is this correct?
     86    *( double* ) & grommit->siderealTime = 0.0;
     87   
     88    psFree( slaGrommit );
     89    return ( grommit );
     90}
     91
     92void p_psGrommitFree( psGrommit *grommit )
     93{
     94    psFree( grommit );
     95}
     96
     97psCell *psCellinFPA( psCell *out,
     98                     const psPlane *coord,
     99                     const psFPA *FPA )
     100{
     101    psChip * tmpChip = NULL;
    61102    psCell *tmpCell = NULL;
    62 
    63     tmpChip = psChipinFPA(tmpChip, coord, FPA);
    64     tmpCell = psCellinChip(tmpCell, coord, tmpChip);
    65     return(tmpCell);
    66 }
    67 
    68 
    69 p_psCheckValidChipCoords(double x, double y, psChil *tmpChip)
    70 {
    71     return(0);
    72 }
    73 
    74 psChip *psChipinFPA(psChip *out,
    75                     const psPlane *coord,
    76                     const psFPA *FPA)
    77 {
    78     psFPA *tmpChip = NULL;
    79 
    80     for (tmpChip = FPA->chips; tmpChip != NULL; tmpChip++) {
    81         tmpCoord = psPlaneTransformApply(out, tmpChip->fromFPA, coord);
    82         if (p_psCheckValidChipCoords(tmpCoord->x, tmpCoord->y,
    83                                      tmpChip)) {
    84             psFree(tmpCoord);
    85             return(tmpChip);
    86         }
    87         psFree(tmpCoord);
    88     }
    89     psFree(tmpCoord);
    90     return(NULL);
    91 }
    92 
    93 p_psCheckValidImageCoords(double x, double y, psImage *tmpImage)
    94 {
    95     if ((x < 0.0) ||
    96             (x > (double) tmpImage->numCols) ||
    97             (y < 0.0) ||
    98             (y > (double) tmpImage->numRows)) {
    99         return(0);
    100     }
    101     return(1);
     103   
     104    tmpChip = psChipinFPA( tmpChip, coord, FPA );
     105    tmpCell = psCellinChip( tmpCell, coord, tmpChip );
     106    return ( tmpCell );
     107}
     108
     109
     110int checkValidChipCoords( double x, double y, psChip *tmpChip )
     111{
     112    return ( 0 );
     113}
     114
     115psChip *psChipinFPA( psChip *out,
     116                     const psPlane *coord,
     117                     const psFPA *FPA )
     118{
     119    psArray * chips = FPA->chips;
     120    int nChips = chips->n;
     121    psPlane* tmpCoord = NULL;
     122   
     123    for ( int i = 0; i < nChips; i++ ) {
     124            psChip* tmpChip = chips->data[ i ];
     125            tmpCoord = psPlaneTransformApply( tmpCoord, tmpChip->fromFPA, coord );
     126            if ( checkValidChipCoords( tmpCoord->x, tmpCoord->y,
     127                                       tmpChip ) ) {
     128                    psFree( tmpCoord );
     129                    // XXX: George, you didn't use the out parameter!
     130                    return ( tmpChip );
     131                }
     132            psFree( tmpCoord );
     133        }
     134    psFree( tmpCoord );
     135    return ( NULL );
     136}
     137
     138int checkValidImageCoords( double x, double y, psImage *tmpImage )
     139{
     140    if ( ( x < 0.0 ) ||
     141            ( x > ( double ) tmpImage->numCols ) ||
     142            ( y < 0.0 ) ||
     143            ( y > ( double ) tmpImage->numRows ) ) {
     144            return ( 0 );
     145        }
     146    return ( 1 );
    102147}
    103148
     
    115160XXX: must deallocate memory.
    116161 *****************************************************************************/
    117 psCell *psCellinChip(psCell *out,
    118                      const psPlane *coord,
    119                      const psChip *chip)
    120 {
    121     psCell *tmpCell = NULL;
    122     psReadout *tmpReadout = NULL;
    123     psPlane *tmpCoord = NULL;
    124 
    125     for (tmpCell = chip->cells; tmpCell != NULL; tmpCell++) {
    126         if (tmpCell->readouts != NULL) {
    127             tmpReadout = tmpCell->readouts;
    128             tmpCoord = psPlaneTransformApply(out, tmpCell->fromChip, coord);
    129             if (p_psCheckValidImageCoords(tmpCoord->x, tmpCoord->y,
    130                                           tmpReadout->image)) {
    131                 return(tmpCell);
    132             }
    133         }
    134     }
    135     return(NULL);
    136 }
    137 
    138 psPlane *psCoordCelltoChip(psPlane *out,
     162psCell *psCellinChip( psCell *out,
     163                      const psPlane *coord,
     164                      const psChip *chip )
     165{
     166    psPlane * tmpCoord = NULL;
     167    psArray* cells;
     168   
     169    if ( chip == NULL ) {
     170            return NULL;
     171        }
     172       
     173    cells = chip->cells;
     174   
     175    if ( cells == NULL ) {
     176            return NULL;
     177        }
     178       
     179    for ( int i = 0; i < cells->n; i++ ) {
     180            psCell* tmpCell = ( psCell* ) cells->data[ i ];
     181            psArray* readouts = tmpCell->readouts;
     182            if ( readouts != NULL ) {
     183                    for ( int j = 0; j < readouts->n; j++ ) {
     184                            psReadout* tmpReadout = readouts->data[ j ];
     185                            tmpCoord = psPlaneTransformApply( tmpCoord, tmpCell->fromChip, coord );
     186                            if ( checkValidImageCoords( tmpCoord->x, tmpCoord->y,
     187                                                        tmpReadout->image ) ) {
     188                                    return ( tmpCell );
     189                                }
     190                        }
     191                }
     192        }
     193    return ( NULL );
     194}
     195
     196psPlane *psCoordCelltoChip( psPlane *out,
     197                            const psPlane *in,
     198                            const psCell *cell )
     199{
     200    return ( psPlaneTransformApply( out, cell->toChip, in ) );
     201}
     202
     203psPlane *psCoordChipToFPA( psPlane *out,
    139204                           const psPlane *in,
    140                            const psCell *cell)
    141 {
    142     return(psPlaneTransformApply(out, cell->toChip, in));
    143 }
    144 
    145 psPlane *psCoordChipToFPA(psPlane *out,
     205                           const psChip *chip )
     206{
     207    return ( psPlaneTransformApply( out, chip->toFPA, in ) );
     208}
     209
     210psPlane *psCoordFPAtoTP( psPlane *out,
     211                         const psPlane *in,
     212                         const psFPA *fpa )
     213{
     214    // XXX: This code doesn't work; fpa->toTangentPlane is of the wrong type.
     215    // return(psPlaneTransformApply(out, fpa->toTangentPlane, in));
     216    return ( NULL );
     217}
     218
     219// XXX: must wrap SLA_QAPQK here.
     220psSphere *psCoordTPtoSky( psSphere *out,
    146221                          const psPlane *in,
    147                           const psChip *chip)
    148 {
    149     return(psPlaneTransformApply(out, chip->toFPA, in));
    150 }
    151 
    152 psPlane *psCoordFPAtoTP(psPlane *out,
    153                         const psPlane *in,
    154                         const psFPA *fpa)
    155 {
    156     return(psPlaneTransformApply(out, fpa->toTangentPlane, in));
    157 }
    158 
    159 // XXX: must wrap SLA_QAPQK here.
    160 psSphere *psCoordTPtoSky(psSphere *out,
    161                          const psPlane *in,
    162                          const psGrommit *grommit)
     222                          const psGrommit *grommit )
    163223{
    164224    /*
     
    169229        sla_OAPQK(TYPE, OB1, OB2, *grommit, &RAP, &DAP);
    170230    */
    171 
    172     return(out);
    173 }
    174 
    175 
    176 psPlane *psCoordCellToFPA(psPlane *out,
    177                           const psPlane *in,
    178                           const psCell *cell)
    179 {
    180     return(psPlaneTransformApply(out, cell->toFPA, in));
     231   
     232    return ( out );
     233}
     234
     235
     236psPlane *psCoordCellToFPA( psPlane *out,
     237                           const psPlane *in,
     238                           const psCell *cell )
     239{
     240    return ( psPlaneTransformApply( out, cell->toFPA, in ) );
    181241}
    182242
     
    185245// transformation, as well as a few psPlane structs.  Can this be implemented
    186246// better?
    187 psSphere *psCoordCelltoSky(psSphere *out,
     247psSphere *psCoordCelltoSky( psSphere *out,
     248                            const psPlane *in,
     249                            const psCell *cell )
     250{
     251    psPlane * tmp1 = NULL;
     252    psPlane *tmp2 = NULL;
     253    psFPA *parFPA = ( cell->parent ) ->parent;
     254    psGrommit *tmpGrommit = NULL;
     255   
     256    tmp1 = psPlaneTransformApply( tmp1, cell->toFPA, in );
     257    tmp2 = psPlaneTransformApply( tmp2, parFPA->toTangentPlane, tmp1 );
     258    tmpGrommit = psGrommitAlloc( parFPA->exposure );
     259    tmp3 = psCoordTPtoSky( out, tmp2, psGrommit );
     260   
     261    psFree( tmp1 );
     262    psFree( tmp2 );
     263    psFree( tmpGrommit );
     264   
     265    return ( psCoordTPtoSky( out, tmp2, psGrommit ) );
     266   
     267}
     268
     269psSphere *psCoordCelltoSkyQuick( psSphere *out,
     270                                 const psPlane *in,
     271                                 const psCell *cell )
     272{
     273    psPlane * tmp1 = NULL;
     274   
     275    tmp1 = psPlaneTransformApply( tmp1, cell->toSky, in );
     276   
     277    //XXX: Do something to convert the linear coords in tmp1 to spherical
     278    // coords in out.
     279   
     280    psFree( tmp1 );
     281   
     282    return ( out );
     283}
     284
     285// XXX: must wrap SLA_AOPQK here.
     286psPlane *psCoordSkytoTP( psPlane *out,
     287                         const psSphere *in,
     288                         const psGrommit *grommit )
     289{
     290    extern void sla_AOPQK ( RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB );
     291    double AOB;
     292    double ZOB;
     293    double HOB;
     294    double DOB;
     295    double ROB;
     296   
     297    if ( out == NULL ) {
     298            out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
     299        }
     300       
     301    sla_AOPQK( psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB );
     302    out->x = XXX;
     303    out->y = XXX;
     304    return ( out );
     305}
     306
     307psPlane *psCoordTPtoFPA( psPlane *out,
     308                         const psPlane *in,
     309                         const psFPA *fpa )
     310{
     311    return ( psPlaneTransformApply( out, fpa->fromTangentPlane, in ) );
     312}
     313
     314psPlane *psCoordFPAtoChip( psPlane *out,
    188315                           const psPlane *in,
    189                            const psCell *cell)
    190 {
    191     psPlane *tmp1 = NULL;
    192     psPlane *tmp2 = NULL;
    193     psFPA *parFPA = (cell->parent)->parent;
    194     psGrommit *tmpGrommit = NULL;
    195 
    196     tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in)
    197            tmp2 = psPlaneTransformApply(tmp2, parFPA->toTangentPlane, tmp1)
    198                   tmpGrommit = psGrommitAlloc(parFPA->exposure)
    199                                tmp3 = psCoordTPtoSky(out, tmp2, psGrommit);
    200 
    201     psFree(tmp1);
    202     psFree(tmp2);
    203     psFree(tmpGrommit);
    204 
    205     return(psCoordTPtoSky(out, tmp2, psGrommit);
    206        }
    207 
    208        psSphere *psCoordCelltoSkyQuick(psSphere *out,
    209                                        const psPlane *in,
    210                                        const psCell *cell)
    211        {
    212            psPlane *tmp1 = NULL;
    213 
    214            tmp1 = psPlaneTransformApply(tmp1, cell->toSky, in);
    215 
    216            //XXX: Do something to convert the linear coords in tmp1 to spherical
    217            // coords in out.
    218 
    219            free(tmp1)
    220 
    221            return(out);
    222        }
    223 
    224        // XXX: must wrap SLA_AOPQK here.
    225        psPlane *psCoordSkytoTP(psPlane *out,
    226                                const psSphere *in,
    227                                const psGrommit *grommit)
    228        {
    229            extern void sla_AOPQK (RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB);
    230            double AOB;
    231            double ZOB;
    232            double HOB;
    233            double DOB;
    234            double ROB;
    235 
    236            if (out == NULL) {
    237                out = (psPlane *) psAlloc(sizeof(psPlane));
    238            }
    239 
    240            sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB);
    241            out->x = XXX;
    242            out->y = XXX;
    243            return(out);
    244        }
    245 
    246        psPlane *psCoordTPtoFPA(psPlane *out,
    247                                const psPlane *in,
    248                                const psFPA *fpa)
    249        {
    250            return(psPlaneTransformApply(out, fpa->fromTangentPlane, in));
    251        }
    252 
    253        psPlane *psCoordFPAtoChip(psPlane *out,
    254                                  const psPlane *in,
    255                                  const psChip *chip)
    256        {
    257            return(psPlaneTransformApply(out, chip->fromFPA, in));
    258        }
    259 
    260 
    261        psPlane *psCoordChiptoCell(psPlane *out,
    262                                   const psPlane *in,
    263                                   const psCell *cell)
    264        {
    265            return(psPlaneTransformApply(out, cell->fromChip, in));
    266        }
    267 
    268        psPlane *psCoordSkytoCell(psPlane *out,
    269                                  const psSphere *in,
    270                                  const psCell *cell)
    271        {
    272            out = psCoordSkytoTP(out, in, tmpGrommit);
    273            out = psCoordTPtoFPA(out, out, whichFPA);
    274            out = psCoordFPAtoChip(out, out, whichChip);
    275            out = psCoordChiptoCell(out, out, whichCell);
    276 
    277            return(out);
    278        }
    279 
    280        psPlane *psCoordSkytoCellQuick(psPlane *out,
    281                                       const psSphere *in,
    282                                       const psCell *cell)
    283        {
    284            if (out == NULL) {
    285                out = (psPlane *) psAlloc(sizeof(psPlane));
    286            }
    287 
    288            return(out);
    289        }
    290 
    291 
     316                           const psChip *chip )
     317{
     318    return ( psPlaneTransformApply( out, chip->fromFPA, in ) );
     319}
     320
     321
     322psPlane *psCoordChiptoCell( psPlane *out,
     323                            const psPlane *in,
     324                            const psCell *cell )
     325{
     326    return ( psPlaneTransformApply( out, cell->fromChip, in ) );
     327}
     328
     329psPlane *psCoordSkytoCell( psPlane *out,
     330                           const psSphere *in,
     331                           const psCell *cell )
     332{
     333    out = psCoordSkytoTP( out, in, tmpGrommit );
     334    out = psCoordTPtoFPA( out, out, whichFPA );
     335    out = psCoordFPAtoChip( out, out, whichChip );
     336    out = psCoordChiptoCell( out, out, whichCell );
     337   
     338    return ( out );
     339}
     340
     341psPlane *psCoordSkytoCellQuick( psPlane *out,
     342                                const psSphere *in,
     343                                const psCell *cell )
     344{
     345    if ( out == NULL ) {
     346            out = ( psPlane * ) psAlloc( sizeof( psPlane ) );
     347        }
     348       
     349    return ( out );
     350}
     351
     352
     353
     354
  • trunk/psLib/src/astronomy/psAstrometry.h

    r1333 r1382  
    1 /** @file  psCoord2.h
    2  *
    3  *  @brief Contains basic coordinate transformation definitions and operations
    4  *
    5  *  This file defines the basic types for astronomical coordinate
    6  *  transformation
    7  *
    8  *  @ingroup AstroImage
    9  *
    10  *  @author George Gusciora, MHPCC
    11  *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-29 04:22:26 $
    14  *
    15  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    16  */
    17 
    18 # ifndef PS_COORD2_H
    19 # define PS_COORD2_H
     1/** @file  psAstrometry.h
     2*
     3*  @brief This file defines the basic types for astronomical coordinate
     4*  transformation
     5*
     6*  @ingroup AstroImage
     7*
     8*  @author George Gusciora, MHPCC
     9*
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-04 22:11:09 $
     12*
     13*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     14*/
     15
     16# ifndef PS_ASTROMETRY_H
     17# define PS_ASTROMETRY_H
    2018
    2119#include "psType.h"
     
    2422#include "psList.h"
    2523#include "psFunctions.h"
     24#include "psMetadata.h"
     25#include "psCoord.h"
     26#include "psPhotometry.h"
     27
     28struct psCell;
     29struct psChip;
     30struct psFPA;
     31struct psExposure;
     32
     33/// @addtogroup AstroImage
     34/// @{
    2635
    2736typedef struct
    28 {
    29     const double latitude;             ///<
    30     const double sinLat, cosLat;       ///<
    31     const double abberationMag;        ///<
    32     const double height;               ///<
    33     const double temperature;          ///<
    34     const double pressure;             ///<
    35     const double humidity;             ///<
    36     const double wavelength;           ///<
    37     const double lapseRate;            ///<
    38     const double refractA, refractB;   ///<
    39     const double longitudeOffset;      ///<
    40     const double siderealTime;         ///<
    41 }
     37    {
     38        const double latitude;             ///<
     39        const double sinLat, cosLat;       ///<
     40        const double abberationMag;        ///<
     41        const double height;               ///<
     42        const double temperature;          ///<
     43        const double pressure;             ///<
     44        const double humidity;             ///<
     45        const double wavelength;           ///<
     46        const double lapseRate;            ///<
     47        const double refractA, refractB;   ///<
     48        const double longitudeOffset;      ///<
     49        const double siderealTime;         ///<
     50    }
    4251psGrommit;
    4352
    4453typedef struct
    45 {
    46     int nX, nY;               ///<
    47     double x0, y0;            ///<
    48     double xScale, yScale;    ///<
    49     double **x, **y;          ///<
    50 }
     54    {
     55        int nX, nY;               ///<
     56        double x0, y0;            ///<
     57        double xScale, yScale;    ///<
     58        double **x, **y;          ///<
     59    }
    5160psFixedPattern;
    5261
    53 psGrommit *psGrommitAlloc(const psExposure *exp);
    54 
    55 void p_psGrommitFree(psGrommit *grommit);
    56 
    57 psCell *psCellinFPA(psCell *out,
    58                     const psPlane *coord,
    59                     const psFPA *FPA);
    60 
    61 psChip *psChipinFPA(psChip *out,
    62                     const psPlane *coord,
    63                     const psFPA *FPA);
    64 
    65 psCell *psCellinChip(psCell *out,
     62/** Readout data structure.
     63 *
     64 *  A readout is the result of a single read of a cell (or a portion thereof).
     65 *  It contains a pointer to the pixel data, and additional pointers to the
     66 *  objects found in the readout, and the readout metadata.  It also contains
     67 *  the offset from the lower-left corner of the chip, in the case that the
     68 *  CCD was windowed.
     69 *
     70 */
     71typedef struct
     72    {
     73        const unsigned int colBins;        ///< Amount of binning in x-dimension
     74        const unsigned int rowBins;        ///< Amount of binning in y-dimension
     75        const int col0;                    ///< Offset from the left of chip.
     76        const int row0;                    ///< Offset from the bottom of chip.
     77       
     78        psImage* image;                    ///< imaging area of Readout
     79        psList* objects;                  ///< objects derived from Readout
     80        psMetadata* metadata;              ///< readout-level metadata
     81    }
     82psReadout;
     83
     84/** Cell data structure
     85 *
     86 *  A cell consists of one or more readouts.  It also contains a pointer to the
     87 *  cell's metadata, and its parent chip.  On the astrometry side, it also
     88 *  contains coordinate transforms from the cell to chip, from the cell to
     89 *  focal-plane, as well as a "quick and dirty" tranform from the cell to
     90 *  sky coordinates.
     91 *
     92 */
     93typedef struct psCell
     94    {
     95        psArray* readouts;                 ///< readouts from the cell
     96        psMetadata* metadata;              ///< cell-level metadata
     97       
     98        psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
     99        psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
     100        psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
     101        psPlaneTransform* toSky;           ///< transformations from cell to sky coordinates
     102       
     103        struct psChip* parent;             ///< chip in which contains this cell
     104    }
     105psCell;
     106
     107/** Chip data structure
     108 *
     109 *  A chip consists of one or more cells (according to the number of amplifiers
     110 *  on the CCD). It contains a pointer to the chip's metadata, and a pointer   
     111 *  to the parent focal plane.  For astrometry, ot contains a coordinate
     112 *  transform from the chip to the focal plane, and vis-versa.
     113 *
     114 */
     115typedef struct psChip
     116    {
     117        psArray* cells;                    ///< cells in the chip
     118        psMetadata* metadata;              ///< chip-level metadata
     119       
     120        psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
     121        psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
     122       
     123        struct psFPA* parent;              ///< FPA which contains this chip
     124    }
     125psChip;
     126
     127/** A Focal-Plane
     128 *
     129 *  A focal plane consists of one or more chips (according to the number of
     130 *  contiguous silicon).  It contains pointers to the focal-plane's metadata
     131 *  and the exposure information.  For astrometry, it contains a transformation
     132 *  from the focal plane to the tangent plane and the fixed pattern residuals.
     133 *  Since colors are involved in the transformation, it is necessary to specify
     134 *  the color the transformation is defined.  We also include some values to
     135 *  characterize the quality of the transformation: the root square deviation
     136 *  for the x and y transformation fits, and the chi-squared for the
     137 *  transformation fit.
     138 *
     139 */
     140typedef struct psFPA
     141    {
     142        psArray* chips;                    ///< chips in the focal plane array
     143        psMetadata* metadata;              ///< focal-plane's metadata
     144       
     145        psPlaneDistort* fromTangentPlane;  ///< transformation from tangent plane to focal plane
     146        psPlaneDistort* toTangentPlane;    ///< transformation from focal plane to tangent plane
     147        psFixedPattern* pattern;           ///< fixed pattern residual offsets
     148       
     149        const struct psExposure* exposure; ///< information about this exposure
     150       
     151        psPhotSystem* colorPlus;           ///< Color reference
     152        psPhotSystem* colorMinus;          ///< Color reference
     153       
     154        float rmsX;                        ///< RMS for x transformation fits
     155        float rmsY;                        ///< RMS for y transformation fits
     156        float chi2;                        ///< chi^2 of astrometric solution
     157    }
     158psFPA;
     159
     160/** Exposure Information
     161 *
     162 *  Several quantities from the telescope in order to make a first guess at
     163 *  the astrometric solution.  From these quantities, further quantities can
     164 *  be derivedand stored for later use.
     165 *
     166 */
     167typedef struct psExposure
     168    {
     169        const double ra;                  ///< Telescope boresight, right ascention
     170        const double dec;                 ///< Telescope boresight, declination
     171        const double hourAngle;           ///< Hour angle
     172        const double zenith;              ///< Zenith distance
     173        const double azimuth;             ///< Azimuth
     174        const double localTime;           ///< Local Sidereal Time
     175        const float date;                 ///< Modified Jullian Date of observation
     176        const float rotAngle;             ///< Rotator position angle
     177        const float temperature;          ///< Air temperature, for estimating refraction
     178        const float pressure;             ///< Air pressure, for calculating refraction
     179        const float humidity;             ///< Relative humidity, for refraction
     180        const float exposureTime;         ///< Exposure time
     181       
     182        /* Derived quantities */
     183        const float positionAngle;        ///< Position angle
     184        const float parallacticAngle;     ///< Parallactic angle
     185        const float airmass;              ///< Airmass, calculated from zenith distance
     186        const float parallacticFactor;    ///< Parallactic factor
     187        const char *cameraName;           ///< name of camera which provided exposure
     188        const char *telescopeName;        ///< name of telescope which provided exposure
     189    }
     190psExposure;
     191
     192psExposure* psExposureAlloc(
     193    double ra,                          ///< Telescope boresight, right ascention
     194    double dec,                         ///< Telescope boresight, declination
     195    double hourAngle,                   ///< Hour angle
     196    double zenith,                      ///< Zenith distance
     197    double azimuth,                     ///< Azimuth
     198    double localTime,                   ///< Local Sidereal Time
     199    float date,                         ///< MJD
     200    float rotAngle,                     ///< Rotator position angle
     201    float temperature,                  ///< Temperature
     202    float pressure,                     ///< Pressure
     203    float humidity,                     ///< Relative humidity
     204    float exposureTime                 ///< Exposure time
     205);
     206
     207psGrommit* psGrommitAlloc( const psExposure* exp );
     208
     209psCell *psCellinFPA( psCell *out,
    66210                     const psPlane *coord,
    67                      const psChip *chip);
    68 
    69 
    70 
    71 
    72 psPlane *psCoordCelltoChip(psPlane *out,
     211                     const psFPA *FPA );
     212                     
     213psChip *psChipinFPA( psChip *out,
     214                     const psPlane *coord,
     215                     const psFPA *FPA );
     216                     
     217psCell *psCellinChip( psCell *out,
     218                      const psPlane *coord,
     219                      const psChip *chip );
     220                     
     221                     
     222                     
     223                     
     224psPlane *psCoordCelltoChip( psPlane *out,
     225                            const psPlane *in,
     226                            const psCell *cell );
     227                           
     228psPlane *psCoordChipToFPA( psPlane *out,
    73229                           const psPlane *in,
    74                            const psCell *cell);
    75 
    76 psPlane *psCoordChipToFPA(psPlane *out,
     230                           const psChip *chip );
     231                           
     232psPlane *psCoordFPAtoTP( psPlane *out,
     233                         const psPlane *in,
     234                         const psFPA *fpa );
     235                         
     236psSphere *psCoordTPtoSky( psSphere *out,
    77237                          const psPlane *in,
    78                           const psChip *chip);
    79 
    80 psPlane *psCoordFPAtoTP(psPlane *out,
    81                         const psPlane *in,
    82                         const psFPA *fpa);
    83 
    84 psSphere *psCoordTPtoSky(psSphere *out,
     238                          const psGrommit *grommit );
     239                         
     240psPlane *psCoordCellToFPA( psPlane *out,
     241                           const psPlane *in,
     242                           const psCell *cell );
     243                           
     244psSphere *psCoordCelltoSky( psSphere *out,
     245                            const psPlane *in,
     246                            const psCell *cell );
     247                           
     248psSphere *psCoordCelltoSkyQuick( psSphere *out,
     249                                 const psPlane *in,
     250                                 const psCell *cell );
     251                                 
     252psPlane *psCoordSkytoTP( psPlane *out,
     253                         const psSphere *in,
     254                         const psGrommit *grommit );
     255                         
     256psPlane *psCoordTPtoFPA( psPlane *out,
    85257                         const psPlane *in,
    86                          const psGrommit *grommit);
    87 
    88 psPlane *psCoordCellToFPA(psPlane *out,
    89                           const psPlane *in,
    90                           const psCell *cell);
    91 
    92 psSphere *psCoordCelltoSky(psSphere *out,
     258                         const psFPA *fpa );
     259                         
     260psPlane *psCoordFPAtoChip( psPlane *out,
    93261                           const psPlane *in,
    94                            const psCell *cell);
    95 
    96 psSphere *psCoordCelltoSkyQuick(psSphere *out,
    97                                 const psPlane *in,
    98                                 const psCell *cell);
    99 
    100 psPlane *psCoordSkytoTP(psPlane *out,
    101                         const psSphere *in,
    102                         const psGrommit *grommit);
    103 
    104 psPlane *psCoordTPtoFPA(psPlane *out,
    105                         const psPlane *in,
    106                         const psFPA *fpa);
    107 
    108 psPlane *psCoordFPAtoChip(psPlane *out,
    109                           const psPlane *in,
    110                           const psChip *chip);
    111 
    112 psPlane *psCoordChiptoCell(psPlane *out,
    113                            const psPlane *in,
    114                            const psCell *cell);
    115 
    116 psPlane *psCoordSkytoCell(psPlane *out,
    117                           const psSphere *in,
    118                           const psCell *cell);
    119 
    120 psPlane *psCoordSkytoCellQuick(psPlane *out,
    121                                const psSphere *in,
    122                                const psCell *cell);
    123 
     262                           const psChip *chip );
     263                           
     264psPlane *psCoordChiptoCell( psPlane *out,
     265                            const psPlane *in,
     266                            const psCell *cell );
     267                           
     268psPlane *psCoordSkytoCell( psPlane *out,
     269                           const psSphere *in,
     270                           const psCell *cell );
     271                           
     272psPlane *psCoordSkytoCellQuick( psPlane *out,
     273                                const psSphere *in,
     274                                const psCell *cell );
     275                               
    124276#endif
  • trunk/psLib/src/astronomy/psMetadata.h

    r1379 r1382  
    1010*  @author Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-04 20:59:41 $
     12*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-04 22:11:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818#define PS_METADATA_H
    1919
     20#include <stdarg.h>
     21#include <stdio.h>
     22#include <fitsio.h>
     23
     24#include "psHash.h"
     25#include "psList.h"
    2026
    2127/// @addtogroup Metadata
     
    3339 */
    3440typedef enum {
    35     PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
    36     PS_META_BOOL,                          ///< Boolean data.
    37     PS_META_S32,                           ///< Signed 32-bit integer data.
    38     PS_META_F32,                           ///< Single-precision float data.
    39     PS_META_F64,                           ///< Double-precision float data.
    40     PS_META_STR,                           ///< String data (Stored in as void *).
    41     PS_META_IMG,                           ///< Image data (Stored in as void *).
    42     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    43     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    44     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    45     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
     41    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
     42    PS_META_BOOL,                           ///< Boolean data.
     43    PS_META_S32,                            ///< Signed 32-bit integer data.
     44    PS_META_F32,                            ///< Single-precision float data.
     45    PS_META_F64,                            ///< Double-precision float data.
     46    PS_META_STR,                            ///< String data (Stored in as void *).
     47    PS_META_IMG,                            ///< Image data (Stored in as void *).
     48    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
     49    PS_META_PNG,                            ///< PNG data (Stored in as void *).
     50    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
     51    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
    4652    PS_META_NTYPE                         ///< Number of types. Must be last.
    4753} psMetadataType;
     
    7884typedef struct psMetadata
    7985    {
    80         psList *restrict list;
    81         psHash *restrict table;
     86        psList* restrict list;
     87        psHash* restrict table;
    8288    }
    8389psMetadata;
     
    102108 */
    103109psMetadataItem *psMetadataItemAlloc(
    104     const char *name,                      ///< Name of metadata item.
    105     psMetadataType type,                   ///< Type of metadata item.
    106     const char *comment,                   ///< Comment for metadata item.
     110    const char *name,                       ///< Name of metadata item.
     111    psMetadataType type,                    ///< Type of metadata item.
     112    const char *comment,                    ///< Comment for metadata item.
    107113    ...                                 ///< Arguments for name formatting and metadata item data.
    108114);
     
    122128 */
    123129psMetadataItem *psMetadataItemAllocV(
    124     const char *name,                      ///< Name of metadata item.
    125     psMetadataType type,                   ///< Type of metadata item.
    126     const char *comment,                   ///< Comment for metadata item.
     130    const char *name,                       ///< Name of metadata item.
     131    psMetadataType type,                    ///< Type of metadata item.
     132    const char *comment,                    ///< Comment for metadata item.
    127133    va_list list                        ///< Arguments for name formatting and metadata item data.
    128134);
     
    145151 */
    146152bool psMetadataAddItem(
    147     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    148     int where,                             ///< Location to be added.
     153    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     154    int where,                              ///< Location to be added.
    149155    psMetadataItem *restrict item       ///< Metadata item to be added.
    150156);
     
    157163 */
    158164bool psMetadataAdd(
    159     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    160     int where,                             ///< Location to be added.
    161     const char *name,                      ///< Name of metadata item.
    162     psMetadataType type,                   ///< Type of metadata item.
    163     const char *comment,                   ///< Comment for metadata item.
     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.
    164170    ...                                 ///< Arguments for name formatting and metadata item data.
    165171);
     
    175181 */
    176182bool psMetadataRemove(
    177     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    178     int where,                             ///< Location to be removed.
     183    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     184    int where,                              ///< Location to be removed.
    179185    const char *restrict key            ///< Name of metadata key.
    180186);
     
    188194 */
    189195psMetadataItem *psMetadataLookup(
    190     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     196    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    191197    const char *restrict key            ///< Name of metadata key.
    192198);
     
    199205 */
    200206psMetadataItem *psMetadataGet(
    201     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     207    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    202208    int where                           ///< Location to be retrieved.
    203209);
     
    210216 */
    211217bool psMetadataSetIterator(
    212     psMetadata *restrict md,               ///< Metadata collection to iterate.
     218    psMetadata *restrict md,                ///< Metadata collection to iterate.
    213219    int where                           ///< Location of iterator.
    214220);
     
    221227 */
    222228psMetadataItem *psMetadataGetNext(
    223     psMetadata *restrict md,               ///< Metadata collection to iterate.
    224     const char *restrict match,            ///< Beginning of key name.
     229    psMetadata *restrict md,                ///< Metadata collection to iterate.
     230    const char *restrict match,             ///< Beginning of key name.
    225231    int which                           ///< Iterator to be used.
    226232);
     
    233239 */
    234240psMetadataItem *psMetadataGetPrevious(
    235     psMetadata *restrict md,               ///< Metadata collection to iterate.
    236     const char *restrict match,            ///< Beginning of key name.
     241    psMetadata *restrict md,                ///< Metadata collection to iterate.
     242    const char *restrict match,             ///< Beginning of key name.
    237243    int which                           ///< Iterator to be used.
    238244);
     
    249255 */
    250256void psMetadataItemPrint(
    251     FILE *fd,                                      ///< Pointer to file to write metadata item.
    252     const char *format,                            ///< Format to print metadata item.
     257    FILE *fd,                                       ///< Pointer to file to write metadata item.
     258    const char *format,                             ///< Format to print metadata item.
    253259    const psMetadataItem *restrict metadataItem ///< Metadata item to print.
    254260);
     
    261267 */
    262268psMetadata *psMetadataReadHeader(
    263     psMetadata *output,                    ///< Resulting metadata from read.
    264     const char *extname,                   ///< File name extension string.
    265     int extnum,                            ///< File name extension number.
     269    psMetadata *output,                     ///< Resulting metadata from read.
     270    const char *extname,                    ///< File name extension string.
     271    int extnum,                             ///< File name extension number.
    266272    const char *filename                ///< Name of file to read.
    267273);
     
    274280 */
    275281psMetadata *psMetadataFReadHeader(
    276     psMetadata *output,                    ///< Resulting metadata from read.
    277     const char *extname,                   ///< File name extension string.
    278     int extnum,                            ///< File name extension number.
    279     fitsfile *fd                        ///< Pointer to file to read.
     282    psMetadata *output,                     ///< Resulting metadata from read.
     283    const char *extname,                    ///< File name extension string.
     284    int extnum,                             ///< File name extension number.
     285    fitsfile *fd                           ///< Pointer to file to read.
    280286);
    281287/// @}
  • trunk/psLib/src/collections/psMetadata.h

    r1380 r1382  
    1010*  @author Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-04 20:59:41 $
     12*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-04 22:11:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818#define PS_METADATA_H
    1919
     20#include <stdarg.h>
     21#include <stdio.h>
     22#include <fitsio.h>
     23
     24#include "psHash.h"
     25#include "psList.h"
    2026
    2127/// @addtogroup Metadata
     
    3339 */
    3440typedef enum {
    35     PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
    36     PS_META_BOOL,                          ///< Boolean data.
    37     PS_META_S32,                           ///< Signed 32-bit integer data.
    38     PS_META_F32,                           ///< Single-precision float data.
    39     PS_META_F64,                           ///< Double-precision float data.
    40     PS_META_STR,                           ///< String data (Stored in as void *).
    41     PS_META_IMG,                           ///< Image data (Stored in as void *).
    42     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    43     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    44     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    45     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
     41    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
     42    PS_META_BOOL,                           ///< Boolean data.
     43    PS_META_S32,                            ///< Signed 32-bit integer data.
     44    PS_META_F32,                            ///< Single-precision float data.
     45    PS_META_F64,                            ///< Double-precision float data.
     46    PS_META_STR,                            ///< String data (Stored in as void *).
     47    PS_META_IMG,                            ///< Image data (Stored in as void *).
     48    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
     49    PS_META_PNG,                            ///< PNG data (Stored in as void *).
     50    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
     51    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
    4652    PS_META_NTYPE                         ///< Number of types. Must be last.
    4753} psMetadataType;
     
    7884typedef struct psMetadata
    7985    {
    80         psList *restrict list;
    81         psHash *restrict table;
     86        psList* restrict list;
     87        psHash* restrict table;
    8288    }
    8389psMetadata;
     
    102108 */
    103109psMetadataItem *psMetadataItemAlloc(
    104     const char *name,                      ///< Name of metadata item.
    105     psMetadataType type,                   ///< Type of metadata item.
    106     const char *comment,                   ///< Comment for metadata item.
     110    const char *name,                       ///< Name of metadata item.
     111    psMetadataType type,                    ///< Type of metadata item.
     112    const char *comment,                    ///< Comment for metadata item.
    107113    ...                                 ///< Arguments for name formatting and metadata item data.
    108114);
     
    122128 */
    123129psMetadataItem *psMetadataItemAllocV(
    124     const char *name,                      ///< Name of metadata item.
    125     psMetadataType type,                   ///< Type of metadata item.
    126     const char *comment,                   ///< Comment for metadata item.
     130    const char *name,                       ///< Name of metadata item.
     131    psMetadataType type,                    ///< Type of metadata item.
     132    const char *comment,                    ///< Comment for metadata item.
    127133    va_list list                        ///< Arguments for name formatting and metadata item data.
    128134);
     
    145151 */
    146152bool psMetadataAddItem(
    147     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    148     int where,                             ///< Location to be added.
     153    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     154    int where,                              ///< Location to be added.
    149155    psMetadataItem *restrict item       ///< Metadata item to be added.
    150156);
     
    157163 */
    158164bool psMetadataAdd(
    159     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    160     int where,                             ///< Location to be added.
    161     const char *name,                      ///< Name of metadata item.
    162     psMetadataType type,                   ///< Type of metadata item.
    163     const char *comment,                   ///< Comment for metadata item.
     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.
    164170    ...                                 ///< Arguments for name formatting and metadata item data.
    165171);
     
    175181 */
    176182bool psMetadataRemove(
    177     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    178     int where,                             ///< Location to be removed.
     183    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     184    int where,                              ///< Location to be removed.
    179185    const char *restrict key            ///< Name of metadata key.
    180186);
     
    188194 */
    189195psMetadataItem *psMetadataLookup(
    190     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     196    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    191197    const char *restrict key            ///< Name of metadata key.
    192198);
     
    199205 */
    200206psMetadataItem *psMetadataGet(
    201     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     207    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    202208    int where                           ///< Location to be retrieved.
    203209);
     
    210216 */
    211217bool psMetadataSetIterator(
    212     psMetadata *restrict md,               ///< Metadata collection to iterate.
     218    psMetadata *restrict md,                ///< Metadata collection to iterate.
    213219    int where                           ///< Location of iterator.
    214220);
     
    221227 */
    222228psMetadataItem *psMetadataGetNext(
    223     psMetadata *restrict md,               ///< Metadata collection to iterate.
    224     const char *restrict match,            ///< Beginning of key name.
     229    psMetadata *restrict md,                ///< Metadata collection to iterate.
     230    const char *restrict match,             ///< Beginning of key name.
    225231    int which                           ///< Iterator to be used.
    226232);
     
    233239 */
    234240psMetadataItem *psMetadataGetPrevious(
    235     psMetadata *restrict md,               ///< Metadata collection to iterate.
    236     const char *restrict match,            ///< Beginning of key name.
     241    psMetadata *restrict md,                ///< Metadata collection to iterate.
     242    const char *restrict match,             ///< Beginning of key name.
    237243    int which                           ///< Iterator to be used.
    238244);
     
    249255 */
    250256void psMetadataItemPrint(
    251     FILE *fd,                                      ///< Pointer to file to write metadata item.
    252     const char *format,                            ///< Format to print metadata item.
     257    FILE *fd,                                       ///< Pointer to file to write metadata item.
     258    const char *format,                             ///< Format to print metadata item.
    253259    const psMetadataItem *restrict metadataItem ///< Metadata item to print.
    254260);
     
    261267 */
    262268psMetadata *psMetadataReadHeader(
    263     psMetadata *output,                    ///< Resulting metadata from read.
    264     const char *extname,                   ///< File name extension string.
    265     int extnum,                            ///< File name extension number.
     269    psMetadata *output,                     ///< Resulting metadata from read.
     270    const char *extname,                    ///< File name extension string.
     271    int extnum,                             ///< File name extension number.
    266272    const char *filename                ///< Name of file to read.
    267273);
     
    274280 */
    275281psMetadata *psMetadataFReadHeader(
    276     psMetadata *output,                    ///< Resulting metadata from read.
    277     const char *extname,                   ///< File name extension string.
    278     int extnum,                            ///< File name extension number.
    279     fitsfile *fd                        ///< Pointer to file to read.
     282    psMetadata *output,                     ///< Resulting metadata from read.
     283    const char *extname,                    ///< File name extension string.
     284    int extnum,                             ///< File name extension number.
     285    fitsfile *fd                           ///< Pointer to file to read.
    280286);
    281287/// @}
  • trunk/psLib/src/dataManip/psFunctions.h

    r1342 r1382  
    11/** @file psFunctions.h
    2  *  \brief Standard Mathematical Functions.
    3  *  \ingroup Stats
    4  *
    5  *  This file will hold the prototypes for procedures which allocate, free,
    6  *  and evaluate various polynomials.  Those polynomial structures are also
    7  *  defined here.
    8  *
    9  *  @ingroup Stats
    10  *
    11  *  @author Someone at IfA
    12  *  @author George Gusciora, MHPCC
    13  *
    14  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-07-29 23:34:24 $
    16  *
    17  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    18  */
     2*  \brief Standard Mathematical Functions.
     3*  \ingroup Stats
     4*
     5*  This file will hold the prototypes for procedures which allocate, free,
     6*  and evaluate various polynomials.  Those polynomial structures are also
     7*  defined here.
     8*
     9*  @ingroup Stats
     10*
     11*  @author Someone at IfA
     12*  @author George Gusciora, MHPCC
     13*
     14*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-04 22:11:09 $
     16*
     17*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     18*/
    1919
    2020#if !defined(PS_FUNCTIONS_H)
    2121#define PS_FUNCTIONS_H
     22
     23#include <stdbool.h>
     24
    2225#include "psVector.h"
    2326
     
    3134
    3235float
    33 psGaussian(float x,        ///< Value at which to evaluate
    34            float mean,     ///< Mean for the Gaussian
    35            float stddev,   ///< Standard deviation for the Gaussian
    36            bool normal      ///< Indicates whether result should be normalized
     36psGaussian( float x,         ///< Value at which to evaluate
     37            float mean,      ///< Mean for the Gaussian
     38            float stddev,    ///< Standard deviation for the Gaussian
     39            bool normal      ///< Indicates whether result should be normalized
    3740          );
    38 
    39 
     41         
     42         
    4043/** Produce a vector of random numbers from a Gaussian distribution with
    4144    the specified mean and sigma */
    42 psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
    43                         float sigma,   ///< The sigma of the Gaussian
    44                         int Npts);     ///< The size of the vector
    45 
    46 
    47 
    48 
    49 
     45psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
     46                         float sigma,    ///< The sigma of the Gaussian
     47                         int Npts );     ///< The size of the vector
     48                         
     49                         
     50                         
     51                         
     52                         
    5053/** One-dimensional polynomial */
    5154typedef struct
    52 {
    53     int n;           ///< Number of terms
    54     float *coeff;    ///< Coefficients
    55     float *coeffErr; ///< Error in coefficients
    56     char *mask;      ///< Coefficient mask
    57 }
     55    {
     56        int n;           ///< Number of terms
     57        float *coeff;    ///< Coefficients
     58        float *coeffErr; ///< Error in coefficients
     59        char *mask;      ///< Coefficient mask
     60    }
    5861psPolynomial1D;
    5962
    6063/** Two-dimensional polynomial */
    6164typedef struct
    62 {
    63     int nX, nY;    ///< Number of terms in x and y
    64     float **coeff;   ///< Coefficients
    65     float **coeffErr;   ///< Error in coefficients
    66     char **mask;   ///< Coefficients mask
    67 }
     65    {
     66        int nX, nY;    ///< Number of terms in x and y
     67        float **coeff;   ///< Coefficients
     68        float **coeffErr;   ///< Error in coefficients
     69        char **mask;   ///< Coefficients mask
     70    }
    6871psPolynomial2D;
    6972
    7073/** Three-dimensional polynomial */
    7174typedef struct
    72 {
    73     int nX, nY, nZ;   ///< Number of terms in x, y and z
    74     float ***coeff;    ///< Coefficients
    75     float ***coeffErr;    ///< Error in coefficients
    76     char ***mask;    ///< Coefficients mask
    77 }
     75    {
     76        int nX, nY, nZ;   ///< Number of terms in x, y and z
     77        float ***coeff;    ///< Coefficients
     78        float ***coeffErr;    ///< Error in coefficients
     79        char ***mask;    ///< Coefficients mask
     80    }
    7881psPolynomial3D;
    7982
    8083/** Four-dimensional polynomial */
    8184typedef struct
    82 {
    83     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    84     float ****coeff;    ///< Coefficients
    85     float ****coeffErr;   ///< Error in coefficients
    86     char ****mask;    ///< Coefficients mask
    87 }
     85    {
     86        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     87        float ****coeff;    ///< Coefficients
     88        float ****coeffErr;   ///< Error in coefficients
     89        char ****mask;    ///< Coefficients mask
     90    }
    8891psPolynomial4D;
    8992
     
    9295
    9396/** Constructor */
    94 psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
    95                                    );
    96 /** Constructor */
    97 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    98                                    );
    99 /** Constructor */
    100 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    101                                    );
    102 /** Constructor */
    103 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    104                                    );
    105 
     97psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
     98                                   );
     99/** Constructor */
     100psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     101                                   );
     102/** Constructor */
     103psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     104                                   );
     105/** Constructor */
     106psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     107                                   );
     108                                   
    106109/** Evaluate 1D polynomial */
    107110float
    108 psPolynomial1DEval(float x,  ///< Value at which to evaluate
    109                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
    110                   );
    111 
     111psPolynomial1DEval( float x,   ///< Value at which to evaluate
     112                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
     113                  );
     114                 
    112115/** Evaluate 2D polynomial */
    113116float
    114 psPolynomial2DEval(float x,  ///< Value x at which to evaluate
    115                    float y,  ///< Value y at which to evaluate
    116                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
    117                   );
    118 
     117psPolynomial2DEval( float x,   ///< Value x at which to evaluate
     118                    float y,   ///< Value y at which to evaluate
     119                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
     120                  );
     121                 
    119122/** Evaluate 3D polynomial */
    120123float
    121 psPolynomial3DEval(float x,  ///< Value x at which to evaluate
    122                    float y,  ///< Value y at which to evaluate
    123                    float z,  ///< Value z at which to evaluate
    124                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
    125                   );
    126 
     124psPolynomial3DEval( float x,   ///< Value x at which to evaluate
     125                    float y,   ///< Value y at which to evaluate
     126                    float z,   ///< Value z at which to evaluate
     127                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
     128                  );
     129                 
    127130/** Evaluate 4D polynomial */
    128131float
    129 psPolynomial4DEval(float w,  ///< Value w at which to evaluate
    130                    float x,  ///< Value x at which to evaluate
    131                    float y,  ///< Value y at which to evaluate
    132                    float z,  ///< Value z at which to evaluate
    133                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
    134                   );
    135 
     132psPolynomial4DEval( float w,   ///< Value w at which to evaluate
     133                    float x,   ///< Value x at which to evaluate
     134                    float y,   ///< Value y at which to evaluate
     135                    float z,   ///< Value z at which to evaluate
     136                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
     137                  );
     138                 
    136139/*****************************************************************************/
    137140
     
    140143/** Double-precision one-dimensional polynomial */
    141144typedef struct
    142 {
    143     int n;    ///< Number of terms
    144     double *coeff;   ///< Coefficients
    145     double *coeffErr;   ///< Error in coefficients
    146     char *mask;    ///< Coefficient mask
    147 }
     145    {
     146        int n;    ///< Number of terms
     147        double *coeff;   ///< Coefficients
     148        double *coeffErr;   ///< Error in coefficients
     149        char *mask;    ///< Coefficient mask
     150    }
    148151psDPolynomial1D;
    149152
    150153/** Double-precision two-dimensional polynomial */
    151154typedef struct
    152 {
    153     int nX, nY;    ///< Number of terms in x and y
    154     double **coeff;   ///< Coefficients
    155     double **coeffErr;    ///< Error in coefficients
    156     char **mask;   ///< Coefficients mask
    157 }
     155    {
     156        int nX, nY;    ///< Number of terms in x and y
     157        double **coeff;   ///< Coefficients
     158        double **coeffErr;    ///< Error in coefficients
     159        char **mask;   ///< Coefficients mask
     160    }
    158161psDPolynomial2D;
    159162
    160163/** Double-precision three-dimensional polynomial */
    161164typedef struct
    162 {
    163     int nX, nY, nZ;   ///< Number of terms in x, y and z
    164     double ***coeff;   ///< Coefficients
    165     double ***coeffErr;   ///< Error in coefficients
    166     char ***mask;    ///< Coefficient mask
    167 }
     165    {
     166        int nX, nY, nZ;   ///< Number of terms in x, y and z
     167        double ***coeff;   ///< Coefficients
     168        double ***coeffErr;   ///< Error in coefficients
     169        char ***mask;    ///< Coefficient mask
     170    }
    168171psDPolynomial3D;
    169172
    170173/** Double-precision four-dimensional polynomial */
    171174typedef struct
    172 {
    173     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    174     double ****coeff;    ///< Coefficients
    175     double ****coeffErr;   ///< Error in coefficients
    176     char ****mask;    ///< Coefficients mask
    177 }
     175    {
     176        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     177        double ****coeff;    ///< Coefficients
     178        double ****coeffErr;   ///< Error in coefficients
     179        char ****mask;    ///< Coefficients mask
     180    }
    178181psDPolynomial4D;
    179182
    180183/** Constructor */
    181 psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
    182                                      );
    183 /** Constructor */
    184 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    185                                      );
    186 /** Constructor */
    187 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    188                                      );
    189 /** Constructor */
    190 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    191                                      );
    192 
     184psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
     185                                     );
     186/** Constructor */
     187psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     188                                     );
     189/** Constructor */
     190psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     191                                     );
     192/** Constructor */
     193psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     194                                     );
     195                                     
    193196/** Evaluate 1D polynomial (double precision) */
    194197double
    195 psDPolynomial1DEval(double x,  ///< Value at which to evaluate
    196                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
    197                    );
    198 
     198psDPolynomial1DEval( double x,   ///< Value at which to evaluate
     199                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
     200                   );
     201                   
    199202/** Evaluate 2D polynomial (double precision) */
    200203double
    201 psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
    202                     double y,  ///< Value y at which to evaluate
    203                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
    204                    );
    205 
     204psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
     205                     double y,   ///< Value y at which to evaluate
     206                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
     207                   );
     208                   
    206209/** Evaluate 3D polynomial (double precision) */
    207210double
    208 psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
    209                     double y,  ///< Value y at which to evaluate
    210                     double z,  ///< Value z at which to evaluate
    211                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
    212                    );
    213 
     211psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
     212                     double y,   ///< Value y at which to evaluate
     213                     double z,   ///< Value z at which to evaluate
     214                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
     215                   );
     216                   
    214217/** Evaluate 4D polynomial (double precision) */
    215218double
    216 psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
    217                     double x,  ///< Value x at which to evaluate
    218                     double y,  ///< Value y at which to evaluate
    219                     double z,  ///< Value z at which to evaluate
    220                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
    221                    );
    222 
     219psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
     220                     double x,   ///< Value x at which to evaluate
     221                     double y,   ///< Value y at which to evaluate
     222                     double z,   ///< Value z at which to evaluate
     223                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
     224                   );
     225                   
    223226/* \} */ // End of MathGroup Functions
    224227
  • trunk/psLib/src/math/psPolynomial.h

    r1342 r1382  
    11/** @file psFunctions.h
    2  *  \brief Standard Mathematical Functions.
    3  *  \ingroup Stats
    4  *
    5  *  This file will hold the prototypes for procedures which allocate, free,
    6  *  and evaluate various polynomials.  Those polynomial structures are also
    7  *  defined here.
    8  *
    9  *  @ingroup Stats
    10  *
    11  *  @author Someone at IfA
    12  *  @author George Gusciora, MHPCC
    13  *
    14  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-07-29 23:34:24 $
    16  *
    17  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    18  */
     2*  \brief Standard Mathematical Functions.
     3*  \ingroup Stats
     4*
     5*  This file will hold the prototypes for procedures which allocate, free,
     6*  and evaluate various polynomials.  Those polynomial structures are also
     7*  defined here.
     8*
     9*  @ingroup Stats
     10*
     11*  @author Someone at IfA
     12*  @author George Gusciora, MHPCC
     13*
     14*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-04 22:11:09 $
     16*
     17*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     18*/
    1919
    2020#if !defined(PS_FUNCTIONS_H)
    2121#define PS_FUNCTIONS_H
     22
     23#include <stdbool.h>
     24
    2225#include "psVector.h"
    2326
     
    3134
    3235float
    33 psGaussian(float x,        ///< Value at which to evaluate
    34            float mean,     ///< Mean for the Gaussian
    35            float stddev,   ///< Standard deviation for the Gaussian
    36            bool normal      ///< Indicates whether result should be normalized
     36psGaussian( float x,         ///< Value at which to evaluate
     37            float mean,      ///< Mean for the Gaussian
     38            float stddev,    ///< Standard deviation for the Gaussian
     39            bool normal      ///< Indicates whether result should be normalized
    3740          );
    38 
    39 
     41         
     42         
    4043/** Produce a vector of random numbers from a Gaussian distribution with
    4144    the specified mean and sigma */
    42 psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
    43                         float sigma,   ///< The sigma of the Gaussian
    44                         int Npts);     ///< The size of the vector
    45 
    46 
    47 
    48 
    49 
     45psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
     46                         float sigma,    ///< The sigma of the Gaussian
     47                         int Npts );     ///< The size of the vector
     48                         
     49                         
     50                         
     51                         
     52                         
    5053/** One-dimensional polynomial */
    5154typedef struct
    52 {
    53     int n;           ///< Number of terms
    54     float *coeff;    ///< Coefficients
    55     float *coeffErr; ///< Error in coefficients
    56     char *mask;      ///< Coefficient mask
    57 }
     55    {
     56        int n;           ///< Number of terms
     57        float *coeff;    ///< Coefficients
     58        float *coeffErr; ///< Error in coefficients
     59        char *mask;      ///< Coefficient mask
     60    }
    5861psPolynomial1D;
    5962
    6063/** Two-dimensional polynomial */
    6164typedef struct
    62 {
    63     int nX, nY;    ///< Number of terms in x and y
    64     float **coeff;   ///< Coefficients
    65     float **coeffErr;   ///< Error in coefficients
    66     char **mask;   ///< Coefficients mask
    67 }
     65    {
     66        int nX, nY;    ///< Number of terms in x and y
     67        float **coeff;   ///< Coefficients
     68        float **coeffErr;   ///< Error in coefficients
     69        char **mask;   ///< Coefficients mask
     70    }
    6871psPolynomial2D;
    6972
    7073/** Three-dimensional polynomial */
    7174typedef struct
    72 {
    73     int nX, nY, nZ;   ///< Number of terms in x, y and z
    74     float ***coeff;    ///< Coefficients
    75     float ***coeffErr;    ///< Error in coefficients
    76     char ***mask;    ///< Coefficients mask
    77 }
     75    {
     76        int nX, nY, nZ;   ///< Number of terms in x, y and z
     77        float ***coeff;    ///< Coefficients
     78        float ***coeffErr;    ///< Error in coefficients
     79        char ***mask;    ///< Coefficients mask
     80    }
    7881psPolynomial3D;
    7982
    8083/** Four-dimensional polynomial */
    8184typedef struct
    82 {
    83     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    84     float ****coeff;    ///< Coefficients
    85     float ****coeffErr;   ///< Error in coefficients
    86     char ****mask;    ///< Coefficients mask
    87 }
     85    {
     86        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     87        float ****coeff;    ///< Coefficients
     88        float ****coeffErr;   ///< Error in coefficients
     89        char ****mask;    ///< Coefficients mask
     90    }
    8891psPolynomial4D;
    8992
     
    9295
    9396/** Constructor */
    94 psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
    95                                    );
    96 /** Constructor */
    97 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    98                                    );
    99 /** Constructor */
    100 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    101                                    );
    102 /** Constructor */
    103 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    104                                    );
    105 
     97psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
     98                                   );
     99/** Constructor */
     100psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     101                                   );
     102/** Constructor */
     103psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     104                                   );
     105/** Constructor */
     106psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     107                                   );
     108                                   
    106109/** Evaluate 1D polynomial */
    107110float
    108 psPolynomial1DEval(float x,  ///< Value at which to evaluate
    109                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
    110                   );
    111 
     111psPolynomial1DEval( float x,   ///< Value at which to evaluate
     112                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
     113                  );
     114                 
    112115/** Evaluate 2D polynomial */
    113116float
    114 psPolynomial2DEval(float x,  ///< Value x at which to evaluate
    115                    float y,  ///< Value y at which to evaluate
    116                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
    117                   );
    118 
     117psPolynomial2DEval( float x,   ///< Value x at which to evaluate
     118                    float y,   ///< Value y at which to evaluate
     119                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
     120                  );
     121                 
    119122/** Evaluate 3D polynomial */
    120123float
    121 psPolynomial3DEval(float x,  ///< Value x at which to evaluate
    122                    float y,  ///< Value y at which to evaluate
    123                    float z,  ///< Value z at which to evaluate
    124                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
    125                   );
    126 
     124psPolynomial3DEval( float x,   ///< Value x at which to evaluate
     125                    float y,   ///< Value y at which to evaluate
     126                    float z,   ///< Value z at which to evaluate
     127                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
     128                  );
     129                 
    127130/** Evaluate 4D polynomial */
    128131float
    129 psPolynomial4DEval(float w,  ///< Value w at which to evaluate
    130                    float x,  ///< Value x at which to evaluate
    131                    float y,  ///< Value y at which to evaluate
    132                    float z,  ///< Value z at which to evaluate
    133                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
    134                   );
    135 
     132psPolynomial4DEval( float w,   ///< Value w at which to evaluate
     133                    float x,   ///< Value x at which to evaluate
     134                    float y,   ///< Value y at which to evaluate
     135                    float z,   ///< Value z at which to evaluate
     136                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
     137                  );
     138                 
    136139/*****************************************************************************/
    137140
     
    140143/** Double-precision one-dimensional polynomial */
    141144typedef struct
    142 {
    143     int n;    ///< Number of terms
    144     double *coeff;   ///< Coefficients
    145     double *coeffErr;   ///< Error in coefficients
    146     char *mask;    ///< Coefficient mask
    147 }
     145    {
     146        int n;    ///< Number of terms
     147        double *coeff;   ///< Coefficients
     148        double *coeffErr;   ///< Error in coefficients
     149        char *mask;    ///< Coefficient mask
     150    }
    148151psDPolynomial1D;
    149152
    150153/** Double-precision two-dimensional polynomial */
    151154typedef struct
    152 {
    153     int nX, nY;    ///< Number of terms in x and y
    154     double **coeff;   ///< Coefficients
    155     double **coeffErr;    ///< Error in coefficients
    156     char **mask;   ///< Coefficients mask
    157 }
     155    {
     156        int nX, nY;    ///< Number of terms in x and y
     157        double **coeff;   ///< Coefficients
     158        double **coeffErr;    ///< Error in coefficients
     159        char **mask;   ///< Coefficients mask
     160    }
    158161psDPolynomial2D;
    159162
    160163/** Double-precision three-dimensional polynomial */
    161164typedef struct
    162 {
    163     int nX, nY, nZ;   ///< Number of terms in x, y and z
    164     double ***coeff;   ///< Coefficients
    165     double ***coeffErr;   ///< Error in coefficients
    166     char ***mask;    ///< Coefficient mask
    167 }
     165    {
     166        int nX, nY, nZ;   ///< Number of terms in x, y and z
     167        double ***coeff;   ///< Coefficients
     168        double ***coeffErr;   ///< Error in coefficients
     169        char ***mask;    ///< Coefficient mask
     170    }
    168171psDPolynomial3D;
    169172
    170173/** Double-precision four-dimensional polynomial */
    171174typedef struct
    172 {
    173     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    174     double ****coeff;    ///< Coefficients
    175     double ****coeffErr;   ///< Error in coefficients
    176     char ****mask;    ///< Coefficients mask
    177 }
     175    {
     176        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     177        double ****coeff;    ///< Coefficients
     178        double ****coeffErr;   ///< Error in coefficients
     179        char ****mask;    ///< Coefficients mask
     180    }
    178181psDPolynomial4D;
    179182
    180183/** Constructor */
    181 psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
    182                                      );
    183 /** Constructor */
    184 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    185                                      );
    186 /** Constructor */
    187 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    188                                      );
    189 /** Constructor */
    190 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    191                                      );
    192 
     184psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
     185                                     );
     186/** Constructor */
     187psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     188                                     );
     189/** Constructor */
     190psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     191                                     );
     192/** Constructor */
     193psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     194                                     );
     195                                     
    193196/** Evaluate 1D polynomial (double precision) */
    194197double
    195 psDPolynomial1DEval(double x,  ///< Value at which to evaluate
    196                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
    197                    );
    198 
     198psDPolynomial1DEval( double x,   ///< Value at which to evaluate
     199                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
     200                   );
     201                   
    199202/** Evaluate 2D polynomial (double precision) */
    200203double
    201 psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
    202                     double y,  ///< Value y at which to evaluate
    203                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
    204                    );
    205 
     204psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
     205                     double y,   ///< Value y at which to evaluate
     206                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
     207                   );
     208                   
    206209/** Evaluate 3D polynomial (double precision) */
    207210double
    208 psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
    209                     double y,  ///< Value y at which to evaluate
    210                     double z,  ///< Value z at which to evaluate
    211                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
    212                    );
    213 
     211psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
     212                     double y,   ///< Value y at which to evaluate
     213                     double z,   ///< Value z at which to evaluate
     214                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
     215                   );
     216                   
    214217/** Evaluate 4D polynomial (double precision) */
    215218double
    216 psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
    217                     double x,  ///< Value x at which to evaluate
    218                     double y,  ///< Value y at which to evaluate
    219                     double z,  ///< Value z at which to evaluate
    220                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
    221                    );
    222 
     219psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
     220                     double x,   ///< Value x at which to evaluate
     221                     double y,   ///< Value y at which to evaluate
     222                     double z,   ///< Value z at which to evaluate
     223                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
     224                   );
     225                   
    223226/* \} */ // End of MathGroup Functions
    224227
  • trunk/psLib/src/math/psSpline.h

    r1342 r1382  
    11/** @file psFunctions.h
    2  *  \brief Standard Mathematical Functions.
    3  *  \ingroup Stats
    4  *
    5  *  This file will hold the prototypes for procedures which allocate, free,
    6  *  and evaluate various polynomials.  Those polynomial structures are also
    7  *  defined here.
    8  *
    9  *  @ingroup Stats
    10  *
    11  *  @author Someone at IfA
    12  *  @author George Gusciora, MHPCC
    13  *
    14  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-07-29 23:34:24 $
    16  *
    17  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    18  */
     2*  \brief Standard Mathematical Functions.
     3*  \ingroup Stats
     4*
     5*  This file will hold the prototypes for procedures which allocate, free,
     6*  and evaluate various polynomials.  Those polynomial structures are also
     7*  defined here.
     8*
     9*  @ingroup Stats
     10*
     11*  @author Someone at IfA
     12*  @author George Gusciora, MHPCC
     13*
     14*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-04 22:11:09 $
     16*
     17*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     18*/
    1919
    2020#if !defined(PS_FUNCTIONS_H)
    2121#define PS_FUNCTIONS_H
     22
     23#include <stdbool.h>
     24
    2225#include "psVector.h"
    2326
     
    3134
    3235float
    33 psGaussian(float x,        ///< Value at which to evaluate
    34            float mean,     ///< Mean for the Gaussian
    35            float stddev,   ///< Standard deviation for the Gaussian
    36            bool normal      ///< Indicates whether result should be normalized
     36psGaussian( float x,         ///< Value at which to evaluate
     37            float mean,      ///< Mean for the Gaussian
     38            float stddev,    ///< Standard deviation for the Gaussian
     39            bool normal      ///< Indicates whether result should be normalized
    3740          );
    38 
    39 
     41         
     42         
    4043/** Produce a vector of random numbers from a Gaussian distribution with
    4144    the specified mean and sigma */
    42 psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
    43                         float sigma,   ///< The sigma of the Gaussian
    44                         int Npts);     ///< The size of the vector
    45 
    46 
    47 
    48 
    49 
     45psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
     46                         float sigma,    ///< The sigma of the Gaussian
     47                         int Npts );     ///< The size of the vector
     48                         
     49                         
     50                         
     51                         
     52                         
    5053/** One-dimensional polynomial */
    5154typedef struct
    52 {
    53     int n;           ///< Number of terms
    54     float *coeff;    ///< Coefficients
    55     float *coeffErr; ///< Error in coefficients
    56     char *mask;      ///< Coefficient mask
    57 }
     55    {
     56        int n;           ///< Number of terms
     57        float *coeff;    ///< Coefficients
     58        float *coeffErr; ///< Error in coefficients
     59        char *mask;      ///< Coefficient mask
     60    }
    5861psPolynomial1D;
    5962
    6063/** Two-dimensional polynomial */
    6164typedef struct
    62 {
    63     int nX, nY;    ///< Number of terms in x and y
    64     float **coeff;   ///< Coefficients
    65     float **coeffErr;   ///< Error in coefficients
    66     char **mask;   ///< Coefficients mask
    67 }
     65    {
     66        int nX, nY;    ///< Number of terms in x and y
     67        float **coeff;   ///< Coefficients
     68        float **coeffErr;   ///< Error in coefficients
     69        char **mask;   ///< Coefficients mask
     70    }
    6871psPolynomial2D;
    6972
    7073/** Three-dimensional polynomial */
    7174typedef struct
    72 {
    73     int nX, nY, nZ;   ///< Number of terms in x, y and z
    74     float ***coeff;    ///< Coefficients
    75     float ***coeffErr;    ///< Error in coefficients
    76     char ***mask;    ///< Coefficients mask
    77 }
     75    {
     76        int nX, nY, nZ;   ///< Number of terms in x, y and z
     77        float ***coeff;    ///< Coefficients
     78        float ***coeffErr;    ///< Error in coefficients
     79        char ***mask;    ///< Coefficients mask
     80    }
    7881psPolynomial3D;
    7982
    8083/** Four-dimensional polynomial */
    8184typedef struct
    82 {
    83     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    84     float ****coeff;    ///< Coefficients
    85     float ****coeffErr;   ///< Error in coefficients
    86     char ****mask;    ///< Coefficients mask
    87 }
     85    {
     86        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     87        float ****coeff;    ///< Coefficients
     88        float ****coeffErr;   ///< Error in coefficients
     89        char ****mask;    ///< Coefficients mask
     90    }
    8891psPolynomial4D;
    8992
     
    9295
    9396/** Constructor */
    94 psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
    95                                    );
    96 /** Constructor */
    97 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    98                                    );
    99 /** Constructor */
    100 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    101                                    );
    102 /** Constructor */
    103 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    104                                    );
    105 
     97psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
     98                                   );
     99/** Constructor */
     100psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     101                                   );
     102/** Constructor */
     103psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     104                                   );
     105/** Constructor */
     106psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     107                                   );
     108                                   
    106109/** Evaluate 1D polynomial */
    107110float
    108 psPolynomial1DEval(float x,  ///< Value at which to evaluate
    109                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
    110                   );
    111 
     111psPolynomial1DEval( float x,   ///< Value at which to evaluate
     112                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
     113                  );
     114                 
    112115/** Evaluate 2D polynomial */
    113116float
    114 psPolynomial2DEval(float x,  ///< Value x at which to evaluate
    115                    float y,  ///< Value y at which to evaluate
    116                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
    117                   );
    118 
     117psPolynomial2DEval( float x,   ///< Value x at which to evaluate
     118                    float y,   ///< Value y at which to evaluate
     119                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
     120                  );
     121                 
    119122/** Evaluate 3D polynomial */
    120123float
    121 psPolynomial3DEval(float x,  ///< Value x at which to evaluate
    122                    float y,  ///< Value y at which to evaluate
    123                    float z,  ///< Value z at which to evaluate
    124                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
    125                   );
    126 
     124psPolynomial3DEval( float x,   ///< Value x at which to evaluate
     125                    float y,   ///< Value y at which to evaluate
     126                    float z,   ///< Value z at which to evaluate
     127                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
     128                  );
     129                 
    127130/** Evaluate 4D polynomial */
    128131float
    129 psPolynomial4DEval(float w,  ///< Value w at which to evaluate
    130                    float x,  ///< Value x at which to evaluate
    131                    float y,  ///< Value y at which to evaluate
    132                    float z,  ///< Value z at which to evaluate
    133                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
    134                   );
    135 
     132psPolynomial4DEval( float w,   ///< Value w at which to evaluate
     133                    float x,   ///< Value x at which to evaluate
     134                    float y,   ///< Value y at which to evaluate
     135                    float z,   ///< Value z at which to evaluate
     136                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
     137                  );
     138                 
    136139/*****************************************************************************/
    137140
     
    140143/** Double-precision one-dimensional polynomial */
    141144typedef struct
    142 {
    143     int n;    ///< Number of terms
    144     double *coeff;   ///< Coefficients
    145     double *coeffErr;   ///< Error in coefficients
    146     char *mask;    ///< Coefficient mask
    147 }
     145    {
     146        int n;    ///< Number of terms
     147        double *coeff;   ///< Coefficients
     148        double *coeffErr;   ///< Error in coefficients
     149        char *mask;    ///< Coefficient mask
     150    }
    148151psDPolynomial1D;
    149152
    150153/** Double-precision two-dimensional polynomial */
    151154typedef struct
    152 {
    153     int nX, nY;    ///< Number of terms in x and y
    154     double **coeff;   ///< Coefficients
    155     double **coeffErr;    ///< Error in coefficients
    156     char **mask;   ///< Coefficients mask
    157 }
     155    {
     156        int nX, nY;    ///< Number of terms in x and y
     157        double **coeff;   ///< Coefficients
     158        double **coeffErr;    ///< Error in coefficients
     159        char **mask;   ///< Coefficients mask
     160    }
    158161psDPolynomial2D;
    159162
    160163/** Double-precision three-dimensional polynomial */
    161164typedef struct
    162 {
    163     int nX, nY, nZ;   ///< Number of terms in x, y and z
    164     double ***coeff;   ///< Coefficients
    165     double ***coeffErr;   ///< Error in coefficients
    166     char ***mask;    ///< Coefficient mask
    167 }
     165    {
     166        int nX, nY, nZ;   ///< Number of terms in x, y and z
     167        double ***coeff;   ///< Coefficients
     168        double ***coeffErr;   ///< Error in coefficients
     169        char ***mask;    ///< Coefficient mask
     170    }
    168171psDPolynomial3D;
    169172
    170173/** Double-precision four-dimensional polynomial */
    171174typedef struct
    172 {
    173     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    174     double ****coeff;    ///< Coefficients
    175     double ****coeffErr;   ///< Error in coefficients
    176     char ****mask;    ///< Coefficients mask
    177 }
     175    {
     176        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     177        double ****coeff;    ///< Coefficients
     178        double ****coeffErr;   ///< Error in coefficients
     179        char ****mask;    ///< Coefficients mask
     180    }
    178181psDPolynomial4D;
    179182
    180183/** Constructor */
    181 psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
    182                                      );
    183 /** Constructor */
    184 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    185                                      );
    186 /** Constructor */
    187 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    188                                      );
    189 /** Constructor */
    190 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    191                                      );
    192 
     184psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
     185                                     );
     186/** Constructor */
     187psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     188                                     );
     189/** Constructor */
     190psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     191                                     );
     192/** Constructor */
     193psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     194                                     );
     195                                     
    193196/** Evaluate 1D polynomial (double precision) */
    194197double
    195 psDPolynomial1DEval(double x,  ///< Value at which to evaluate
    196                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
    197                    );
    198 
     198psDPolynomial1DEval( double x,   ///< Value at which to evaluate
     199                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
     200                   );
     201                   
    199202/** Evaluate 2D polynomial (double precision) */
    200203double
    201 psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
    202                     double y,  ///< Value y at which to evaluate
    203                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
    204                    );
    205 
     204psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
     205                     double y,   ///< Value y at which to evaluate
     206                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
     207                   );
     208                   
    206209/** Evaluate 3D polynomial (double precision) */
    207210double
    208 psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
    209                     double y,  ///< Value y at which to evaluate
    210                     double z,  ///< Value z at which to evaluate
    211                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
    212                    );
    213 
     211psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
     212                     double y,   ///< Value y at which to evaluate
     213                     double z,   ///< Value z at which to evaluate
     214                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
     215                   );
     216                   
    214217/** Evaluate 4D polynomial (double precision) */
    215218double
    216 psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
    217                     double x,  ///< Value x at which to evaluate
    218                     double y,  ///< Value y at which to evaluate
    219                     double z,  ///< Value z at which to evaluate
    220                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
    221                    );
    222 
     219psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
     220                     double x,   ///< Value x at which to evaluate
     221                     double y,   ///< Value y at which to evaluate
     222                     double z,   ///< Value z at which to evaluate
     223                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
     224                   );
     225                   
    223226/* \} */ // End of MathGroup Functions
    224227
  • trunk/psLib/src/types/psMetadata.h

    r1380 r1382  
    1010*  @author Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-04 20:59:41 $
     12*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-04 22:11:09 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818#define PS_METADATA_H
    1919
     20#include <stdarg.h>
     21#include <stdio.h>
     22#include <fitsio.h>
     23
     24#include "psHash.h"
     25#include "psList.h"
    2026
    2127/// @addtogroup Metadata
     
    3339 */
    3440typedef enum {
    35     PS_META_ITEM_SET = 0,                  ///< Null. Metadata is in psMetadataItem.items
    36     PS_META_BOOL,                          ///< Boolean data.
    37     PS_META_S32,                           ///< Signed 32-bit integer data.
    38     PS_META_F32,                           ///< Single-precision float data.
    39     PS_META_F64,                           ///< Double-precision float data.
    40     PS_META_STR,                           ///< String data (Stored in as void *).
    41     PS_META_IMG,                           ///< Image data (Stored in as void *).
    42     PS_META_JPEG,                          ///< JPEG data (Stored in as void .
    43     PS_META_PNG,                           ///< PNG data (Stored in as void *).
    44     PS_META_ASTROM,                        ///< Astrometric coefficients (Stored in as void *).
    45     PS_META_UNKNOWN,                       ///< Other data (Stored in as void *).
     41    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
     42    PS_META_BOOL,                           ///< Boolean data.
     43    PS_META_S32,                            ///< Signed 32-bit integer data.
     44    PS_META_F32,                            ///< Single-precision float data.
     45    PS_META_F64,                            ///< Double-precision float data.
     46    PS_META_STR,                            ///< String data (Stored in as void *).
     47    PS_META_IMG,                            ///< Image data (Stored in as void *).
     48    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
     49    PS_META_PNG,                            ///< PNG data (Stored in as void *).
     50    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
     51    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
    4652    PS_META_NTYPE                         ///< Number of types. Must be last.
    4753} psMetadataType;
     
    7884typedef struct psMetadata
    7985    {
    80         psList *restrict list;
    81         psHash *restrict table;
     86        psList* restrict list;
     87        psHash* restrict table;
    8288    }
    8389psMetadata;
     
    102108 */
    103109psMetadataItem *psMetadataItemAlloc(
    104     const char *name,                      ///< Name of metadata item.
    105     psMetadataType type,                   ///< Type of metadata item.
    106     const char *comment,                   ///< Comment for metadata item.
     110    const char *name,                       ///< Name of metadata item.
     111    psMetadataType type,                    ///< Type of metadata item.
     112    const char *comment,                    ///< Comment for metadata item.
    107113    ...                                 ///< Arguments for name formatting and metadata item data.
    108114);
     
    122128 */
    123129psMetadataItem *psMetadataItemAllocV(
    124     const char *name,                      ///< Name of metadata item.
    125     psMetadataType type,                   ///< Type of metadata item.
    126     const char *comment,                   ///< Comment for metadata item.
     130    const char *name,                       ///< Name of metadata item.
     131    psMetadataType type,                    ///< Type of metadata item.
     132    const char *comment,                    ///< Comment for metadata item.
    127133    va_list list                        ///< Arguments for name formatting and metadata item data.
    128134);
     
    145151 */
    146152bool psMetadataAddItem(
    147     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    148     int where,                             ///< Location to be added.
     153    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     154    int where,                              ///< Location to be added.
    149155    psMetadataItem *restrict item       ///< Metadata item to be added.
    150156);
     
    157163 */
    158164bool psMetadataAdd(
    159     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    160     int where,                             ///< Location to be added.
    161     const char *name,                      ///< Name of metadata item.
    162     psMetadataType type,                   ///< Type of metadata item.
    163     const char *comment,                   ///< Comment for metadata item.
     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.
    164170    ...                                 ///< Arguments for name formatting and metadata item data.
    165171);
     
    175181 */
    176182bool psMetadataRemove(
    177     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
    178     int where,                             ///< Location to be removed.
     183    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
     184    int where,                              ///< Location to be removed.
    179185    const char *restrict key            ///< Name of metadata key.
    180186);
     
    188194 */
    189195psMetadataItem *psMetadataLookup(
    190     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     196    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    191197    const char *restrict key            ///< Name of metadata key.
    192198);
     
    199205 */
    200206psMetadataItem *psMetadataGet(
    201     psMetadata *restrict md,               ///< Metadata collection to insert metadat item.
     207    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
    202208    int where                           ///< Location to be retrieved.
    203209);
     
    210216 */
    211217bool psMetadataSetIterator(
    212     psMetadata *restrict md,               ///< Metadata collection to iterate.
     218    psMetadata *restrict md,                ///< Metadata collection to iterate.
    213219    int where                           ///< Location of iterator.
    214220);
     
    221227 */
    222228psMetadataItem *psMetadataGetNext(
    223     psMetadata *restrict md,               ///< Metadata collection to iterate.
    224     const char *restrict match,            ///< Beginning of key name.
     229    psMetadata *restrict md,                ///< Metadata collection to iterate.
     230    const char *restrict match,             ///< Beginning of key name.
    225231    int which                           ///< Iterator to be used.
    226232);
     
    233239 */
    234240psMetadataItem *psMetadataGetPrevious(
    235     psMetadata *restrict md,               ///< Metadata collection to iterate.
    236     const char *restrict match,            ///< Beginning of key name.
     241    psMetadata *restrict md,                ///< Metadata collection to iterate.
     242    const char *restrict match,             ///< Beginning of key name.
    237243    int which                           ///< Iterator to be used.
    238244);
     
    249255 */
    250256void psMetadataItemPrint(
    251     FILE *fd,                                      ///< Pointer to file to write metadata item.
    252     const char *format,                            ///< Format to print metadata item.
     257    FILE *fd,                                       ///< Pointer to file to write metadata item.
     258    const char *format,                             ///< Format to print metadata item.
    253259    const psMetadataItem *restrict metadataItem ///< Metadata item to print.
    254260);
     
    261267 */
    262268psMetadata *psMetadataReadHeader(
    263     psMetadata *output,                    ///< Resulting metadata from read.
    264     const char *extname,                   ///< File name extension string.
    265     int extnum,                            ///< File name extension number.
     269    psMetadata *output,                     ///< Resulting metadata from read.
     270    const char *extname,                    ///< File name extension string.
     271    int extnum,                             ///< File name extension number.
    266272    const char *filename                ///< Name of file to read.
    267273);
     
    274280 */
    275281psMetadata *psMetadataFReadHeader(
    276     psMetadata *output,                    ///< Resulting metadata from read.
    277     const char *extname,                   ///< File name extension string.
    278     int extnum,                            ///< File name extension number.
    279     fitsfile *fd                        ///< Pointer to file to read.
     282    psMetadata *output,                     ///< Resulting metadata from read.
     283    const char *extname,                    ///< File name extension string.
     284    int extnum,                             ///< File name extension number.
     285    fitsfile *fd                           ///< Pointer to file to read.
    280286);
    281287/// @}
Note: See TracChangeset for help on using the changeset viewer.