Changeset 344
- Timestamp:
- Mar 31, 2004, 5:01:04 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 19 edited
-
psAstrom.h (modified) (15 diffs)
-
psBitMask.h (modified) (3 diffs)
-
psDateTime.h (modified) (3 diffs)
-
psDlist.h (modified) (4 diffs)
-
psFFT.h (modified) (2 diffs)
-
psFunctions.h (modified) (6 diffs)
-
psImage.h (modified) (12 diffs)
-
psLogMsg.h (modified) (1 diff)
-
psMatrix.h (modified) (2 diffs)
-
psMemory.h (modified) (3 diffs)
-
psMetaData.h (modified) (3 diffs)
-
psMinimize.h (modified) (2 diffs)
-
psMisc.h (modified) (1 diff)
-
psObject.h (modified) (8 diffs)
-
psPhotom.h (modified) (1 diff)
-
psPosition.h (modified) (6 diffs)
-
psSort.h (modified) (1 diff)
-
psStats.h (modified) (4 diffs)
-
psStdArrays.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psAstrom.h
r343 r344 40 40 typedef struct { 41 41 // Telescope longitude, latitude and height are stored separately, since they don't change with pointing 42 double ra, dec; // !< Telescope boresight43 double ha; // !< Hour angle44 double zd; // !< Zenith distance45 double az; // !< Azimuth46 double lst; // !< Local Sidereal Time47 float mjd; // !< MJD of observation48 float rotAngle; // !< Rotator position angle49 float temp; // !< Air temperature, for estimating refraction50 float pressure; // !< Air pressure, for calculating refraction51 float humidity; // !< Relative humidity, for calculating refraction52 float exptime; // !< Exposure time42 double ra, dec; ///< Telescope boresight 43 double ha; ///< Hour angle 44 double zd; ///< Zenith distance 45 double az; ///< Azimuth 46 double lst; ///< Local Sidereal Time 47 float mjd; ///< MJD of observation 48 float rotAngle; ///< Rotator position angle 49 float temp; ///< Air temperature, for estimating refraction 50 float pressure; ///< Air pressure, for calculating refraction 51 float humidity; ///< Relative humidity, for calculating refraction 52 float exptime; ///< Exposure time 53 53 /* Derived quantities */ 54 float posAngle; // !< Position angle55 float parallactic; // !< Parallactic angle56 float airmass; // !< Airmass, calculated from zenith distance57 float pf; // !< Parallactic factor54 float posAngle; ///< Position angle 55 float parallactic; ///< Parallactic angle 56 float airmass; ///< Airmass, calculated from zenith distance 57 float pf; ///< Parallactic factor 58 58 char *cameraName; ///< name of camera which provided exposure 59 59 char *telescopeName; ///< name of telescope which provided exposure 60 psGrommit *grommit; // !< Data needed to convert from the sky to the tangent plane60 psGrommit *grommit; ///< Data needed to convert from the sky to the tangent plane 61 61 } psExposure; 62 62 … … 64 64 /** The fixed pattern residual offsets. These are specified via a coarse grid of x and y offsets. */ 65 65 typedef struct { 66 int nX, nY; // !< Number of elements in x and y67 double x0, y0; // !< Position of the lower-left corner of the grid on the focal plane68 double xScale, yScale; // !< Scale of the grid69 double **x, **y; // !< The grid of offsets in x and y66 int nX, nY; ///< Number of elements in x and y 67 double x0, y0; ///< Position of the lower-left corner of the grid on the focal plane 68 double xScale, yScale; ///< Scale of the grid 69 double **x, **y; ///< The grid of offsets in x and y 70 70 } psFixedPattern; 71 71 … … 82 82 psDistortion *TPtoFP; ///< Transformation term from 83 83 psDistortion *FPtoTP; ///< Transformation term from 84 psFixedPattern *pattern; // !< Fixed pattern residual offsets84 psFixedPattern *pattern; ///< Fixed pattern residual offsets 85 85 psExposure *exp; ///< information about this exposure 86 86 psPhotSystem colorPlus, colorMinus; ///< Colour reference 87 float rmsX, rmsY; // !< Dispersion in astrometric solution88 float chi2; // !< chi^2 of astrometric solution87 float rmsX, rmsY; ///< Dispersion in astrometric solution 88 float chi2; ///< chi^2 of astrometric solution 89 89 } psFPA; 90 90 … … 98 98 psMetaDataSet *md; ///< Chip-level metadata 99 99 psCoordXform *chipToFPA; ///< Transformations from chip coordinates to FPA coordinates 100 psCoordXform *FPAtoChip; // !< Transformations from FPA coordinates to chip100 psCoordXform *FPAtoChip; ///< Transformations from FPA coordinates to chip 101 101 102 102 struct psFPA *parentFPA; ///< FPA which contains this chip … … 108 108 int nReadouts; ///< number of readouts in this cell realization; each may have its 109 109 ///< own image, objects and overscan. 110 psReadout *readouts; // !< Readouts from the cell110 psReadout *readouts; ///< Readouts from the cell 111 111 psMetaDataSet *md; ///< Cell-level metadata 112 112 … … 120 120 /** a Readout: a collection of pixels */ 121 121 typedef struct { 122 const int x0, y0; // !< Offset from the lower-left corner123 const int nx, ny; // !< Image binning122 const int x0, y0; ///< Offset from the lower-left corner 123 const int nx, ny; ///< Image binning 124 124 psImage *image; ///< imaging area of cell 125 125 psDlist *objects; ///< objects derived from cell 126 126 psImage *overscan; ///< bias region (subimage) of cell 127 psMetaDataSet *md; // !< Readout-level metadata127 psMetaDataSet *md; ///< Readout-level metadata 128 128 } psReadout; 129 129 … … 138 138 /** returns Chip in FPA which contains the given FPA coordinate */ 139 139 psChip * 140 psChipInFPA (psChip *out, // !< Chip to return, or NULL140 psChipInFPA (psChip *out, ///< Chip to return, or NULL 141 141 const psFPA *fpa, ///< FPA description 142 142 const psCoord *coord ///< coordinate in FPA … … 145 145 /** returns Cell in Chip which contains the given chip coordinate */ 146 146 psCell * 147 psCellInChip(psCell *out, // !< Cell to return, or NULL147 psCellInChip(psCell *out, ///< Cell to return, or NULL 148 148 const psChip *chip, ///< chip description 149 149 const psCoord *coord ///< coordinate in chip … … 152 152 /** Return the cell in FPA which contains the given FPA coordinates */ 153 153 psCell * 154 psCellInFPA(psCell *out, // !< Cell to return, or NULL155 const psFPA *fpa, // !< FPA description156 const psCoord *coord // !< Coordinate in FPA154 psCellInFPA(psCell *out, ///< Cell to return, or NULL 155 const psFPA *fpa, ///< FPA description 156 const psCoord *coord ///< Coordinate in FPA 157 157 ); 158 158 … … 160 160 /** Convert (RA,Dec) to cell and cell coordinates */ 161 161 psCoord * 162 psCoordSkyToCell(psCoord *out, // !< Coordinates to return, or NULL163 psCell *cell, // !< Cell to return164 const psFPA *fpa // !< FPA description162 psCoordSkyToCell(psCoord *out, ///< Coordinates to return, or NULL 163 psCell *cell, ///< Cell to return 164 const psFPA *fpa ///< FPA description 165 165 ); 166 166 167 167 /** Convert cell and cell coordinate to (RA,Dec) */ 168 168 psCoord * 169 psCoordCellToSky(psCoord *out, // !< Coordinates to return, or NULL170 const psCell *cell, // !< Cell to get coordinates for171 const psCoord *coord // !< cell coordinates to transform169 psCoordCellToSky(psCoord *out, ///< Coordinates to return, or NULL 170 const psCell *cell, ///< Cell to get coordinates for 171 const psCoord *coord ///< cell coordinates to transform 172 172 ); 173 173 174 174 /** Quick and dirty cell to (RA,Dec) --- employs cellToSky transformation */ 175 175 psCoord * 176 psCoordCellToSkyQuick(psCoord *out, // !< Coordinates to return, or NULL177 const psCell *cell, // !< Cell description178 const psCoord *coord // !< cell coordinates to transform176 psCoordCellToSkyQuick(psCoord *out, ///< Coordinates to return, or NULL 177 const psCell *cell, ///< Cell description 178 const psCoord *coord ///< cell coordinates to transform 179 179 ); 180 180 181 181 /** Convert (RA,Dec) to tangent plane coords */ 182 182 psCoord * 183 psCoordSkyToTP(psCoord *out, // !< Coordinates to return, or NULL184 const psExposure *exp, // !< Exposure description185 const psCoord *coord // !< input Sky coordinate183 psCoordSkyToTP(psCoord *out, ///< Coordinates to return, or NULL 184 const psExposure *exp, ///< Exposure description 185 const psCoord *coord ///< input Sky coordinate 186 186 ); 187 187 188 188 /** Convert tangent plane coords to focal plane coordinates */ 189 189 psCoord * 190 psCoordTPtoFPA(psCoord *out, // !< Coordinates to return, or NULL191 const psFPA *fpa, // !< FPA description192 const psCoord *coord // !< input TP coordinate190 psCoordTPtoFPA(psCoord *out, ///< Coordinates to return, or NULL 191 const psFPA *fpa, ///< FPA description 192 const psCoord *coord ///< input TP coordinate 193 193 ); 194 194 195 195 /** converts the specified FPA coord to the coord on the given Chip */ 196 196 psCoord * 197 psCoordFPAtoChip (psCoord *out, // !< Coordinates to return, or NULL197 psCoordFPAtoChip (psCoord *out, ///< Coordinates to return, or NULL 198 198 const psChip *chip, ///< Chip of interest 199 199 const psCoord *coord ///< input FPA coordinate … … 202 202 /** converts the specified Chip coord to the coord on the given Cell */ 203 203 psCoord * 204 psCoordChiptoCell (psCoord *out, // !< Coordinates to return, or NULL204 psCoordChiptoCell (psCoord *out, ///< Coordinates to return, or NULL 205 205 const psCell *cell, ///< Cell of interest 206 206 const psCoord *coord ///< input Chip coordinate … … 209 209 /** converts the specified Cell coord to the coord on the parent Chip */ 210 210 psCoord * 211 psCoordCelltoChip (psCoord *out, // !< Coordinates to return, or NULL211 psCoordCelltoChip (psCoord *out, ///< Coordinates to return, or NULL 212 212 const psCell *cell, ///< Cell description 213 213 const psCoord *coord ///< input Cell coordinate … … 216 216 /** converts the specified Chip coord to the coord on the parent FPA */ 217 217 psCoord * 218 psCoordChiptoFPA (psCoord *out, // !< Coordinates to return, or NULL218 psCoordChiptoFPA (psCoord *out, ///< Coordinates to return, or NULL 219 219 const psChip *chip, ///< Chip description 220 220 const psCoord *coord ///< input Chip coordinate … … 223 223 /** Convert focal plane coords to tangent plane coordinates */ 224 224 psCoord * 225 psCoordFPAToTP(psCoord *out, // !< Coordinates to return, or NULL226 const psFPA *fpa, // !< FPA description227 const psCoord *coord // !< input FPA coordinate225 psCoordFPAToTP(psCoord *out, ///< Coordinates to return, or NULL 226 const psFPA *fpa, ///< FPA description 227 const psCoord *coord ///< input FPA coordinate 228 228 ); 229 229 230 230 /** Convert tangent plane coords to (RA,Dec) */ 231 231 psCoord * 232 psCoordTPtoSky(psCoord *out, // !< Coordinates to return, or NULL233 const psExposure *exp, // !< Exposure description234 const psCoord *coord // !< input TP coordinate232 psCoordTPtoSky(psCoord *out, ///< Coordinates to return, or NULL 233 const psExposure *exp, ///< Exposure description 234 const psCoord *coord ///< input TP coordinate 235 235 ); 236 236 237 237 /** Convert Cell coords to FPA coordinates */ 238 238 psCoord * 239 psCoordCellToFPA(psCoord *out, // !< Coordinates to return, or NULL240 const psCell *cell, // !< Cell description241 const psCoord *coord // !< Input cell coordinates239 psCoordCellToFPA(psCoord *out, ///< Coordinates to return, or NULL 240 const psCell *cell, ///< Cell description 241 const psCoord *coord ///< Input cell coordinates 242 242 ); 243 243 244 244 /** Get the airmass for a given position and sidereal time */ 245 245 float 246 psGetAirmass(const psCoord *coord, // !< Position on the sky247 double siderealTime, // !< Sidereal time248 float height // !< Height above sea level246 psGetAirmass(const psCoord *coord, ///< Position on the sky 247 double siderealTime, ///< Sidereal time 248 float height ///< Height above sea level 249 249 ); 250 250 251 251 /** Get the parallactic angle for a given position and sidereal time */ 252 252 float 253 psGetParallactic(const psCoord *coord, // !< Position on the sky254 double siderealTime // !< Sidereal time253 psGetParallactic(const psCoord *coord, ///< Position on the sky 254 double siderealTime ///< Sidereal time 255 255 ); 256 256 257 257 /** Estimate atmospheric refraction, along the parallactic */ 258 258 float 259 psGetRefraction(float colour, // !< Colour of object259 psGetRefraction(float colour, ///< Colour of object 260 260 psPhotSystem colorPlus, ///< Colour reference 261 261 psPhotSystem colorMinus, ///< Colour reference 262 const psExposure *exp // !< Telescope pointing information, for airmass, temp and pressure262 const psExposure *exp ///< Telescope pointing information, for airmass, temp and pressure 263 263 ); 264 264 265 265 /** Calculate the parallax factor */ 266 266 psCoord * 267 psGetParallaxFactor(const psExposure *exp // !< Exposure details267 psGetParallaxFactor(const psExposure *exp ///< Exposure details 268 268 ); 269 269 … … 272 272 /** Constructor */ 273 273 psExposure * 274 psExposureAlloc(double ra, double dec, // !< Telescope boresight275 double ha, // !< Hour angle276 double zd, // !< Zenith distance277 double az, // !< Azimuth278 double lst, // !< Local Sidereal Time279 float mjd, // !< MJD280 float rotAngle, // !< Rotator position angle281 float temp, // !< Temperature282 float pressure, // !< Pressure283 float humidity, // !< Relative humidity284 float exptime // !< Exposure time274 psExposureAlloc(double ra, double dec, ///< Telescope boresight 275 double ha, ///< Hour angle 276 double zd, ///< Zenith distance 277 double az, ///< Azimuth 278 double lst, ///< Local Sidereal Time 279 float mjd, ///< MJD 280 float rotAngle, ///< Rotator position angle 281 float temp, ///< Temperature 282 float pressure, ///< Pressure 283 float humidity, ///< Relative humidity 284 float exptime ///< Exposure time 285 285 ); 286 286 287 287 /** Destructor */ 288 288 void 289 psExposureFree(psExposure *restrict myExp // !< Object to destroy289 psExposureFree(psExposure *restrict myExp ///< Object to destroy 290 290 ); 291 291 /* \} */ // End of AstroGroup Functions -
trunk/archive/pslib/include/psBitMask.h
r257 r344 9 9 /** A bitmask of arbitrary length. */ 10 10 typedef struct { 11 int n; // !< Number of chars that form the mask12 char *bits; // !< The bits11 int n; ///< Number of chars that form the mask 12 char *bits; ///< The bits 13 13 } psBitMask; 14 14 … … 19 19 20 20 /** Constructor */ 21 psBitMask *psBitMaskAlloc(int n // !< Number of bits required21 psBitMask *psBitMaskAlloc(int n ///< Number of bits required 22 22 ); 23 23 24 24 /** Destructor */ 25 void psBitMaskFree(psBitMask *restrict myMask // !< Bit mask to destroy25 void psBitMaskFree(psBitMask *restrict myMask ///< Bit mask to destroy 26 26 ); 27 27 … … 30 30 /** Set a bit mask */ 31 31 psBitMask * 32 psBitMaskSet(psBitMask *outMask, // !< Output bit mask or NULL33 const psBitMask *myMask, // !< Input bit mask34 int bit // !< Bit to set32 psBitMaskSet(psBitMask *outMask, ///< Output bit mask or NULL 33 const psBitMask *myMask, ///< Input bit mask 34 int bit ///< Bit to set 35 35 ); 36 36 37 37 /** Check a bit mask. Returns true or false */ 38 38 int 39 psBitMaskTest(const psBitMask *checkMask, // !< Bit mask to check40 int bit // !< Bit to check39 psBitMaskTest(const psBitMask *checkMask, ///< Bit mask to check 40 int bit ///< Bit to check 41 41 ); 42 42 43 43 /** apply the given operator to two bit masks */ 44 44 psBitMask * 45 psBitMaskOp(psBitMask *outMask, // !< Output bit mask or NULL46 const psBitMask *restrict inMask1, // !< Input bit mask 147 char *operator, // !< bit mask operator (AND, OR, XOR)48 const psBitMask *restrict inMask2 // !< Input bit mask 245 psBitMaskOp(psBitMask *outMask, ///< Output bit mask or NULL 46 const psBitMask *restrict inMask1, ///< Input bit mask 1 47 char *operator, ///< bit mask operator (AND, OR, XOR) 48 const psBitMask *restrict inMask2 ///< Input bit mask 2 49 49 ); 50 50 -
trunk/archive/pslib/include/psDateTime.h
r257 r344 21 21 /** Get current sidereal time at longitude \ingroup AstroGroup */ 22 22 double 23 psGetSidereal(float mjd, // !< MJD24 float longitude) // !< Longitude23 psGetSidereal(float mjd, ///< MJD 24 float longitude) ///< Longitude 25 25 ; 26 26 … … 28 28 /** Convert psTime to ISOTime (Human-readable date/time string YYYY/MM/DD,HH:MM:SS.SSS) */ 29 29 char * 30 psTimeToISOTime (psTime time) // !< Input psTime time30 psTimeToISOTime (psTime time) ///< Input psTime time 31 31 ; 32 32 33 33 /** Convert psTime to UTC */ 34 34 double 35 psTimeToUTC (psTime time) // !< Input psTime time35 psTimeToUTC (psTime time) ///< Input psTime time 36 36 ; 37 37 38 38 /** Convert psTime to MJD */ 39 39 double 40 psTimeToMJD (psTime time) // !< Input psTime time40 psTimeToMJD (psTime time) ///< Input psTime time 41 41 ; 42 42 43 43 /** Convert psTime to JD */ 44 44 double 45 psTimeToJD (psTime time) // !< Input psTime time45 psTimeToJD (psTime time) ///< Input psTime time 46 46 ; 47 47 48 48 /** Convert psTime to timeval (struct timeval) */ 49 49 struct timeval * 50 psTimeToTimeval (psTime time) // !< Input psTime time50 psTimeToTimeval (psTime time) ///< Input psTime time 51 51 ; 52 52 53 53 /** Convert psTime to broken-down time (struct tm) */ 54 54 struct tm * 55 psTimeToTm (psTime time) // !< Input psTime time55 psTimeToTm (psTime time) ///< Input psTime time 56 56 ; 57 57 … … 59 59 /** Convert ISOTime (Human-readable date/time string YYYY/MM/DD,HH:MM:SS.SSS) to psTime \ingroup AstroGroup */ 60 60 psTime * 61 psISOTimeToTime (char *input) // !< Input ISOTime time61 psISOTimeToTime (char *input) ///< Input ISOTime time 62 62 ; 63 63 64 64 /** Convert UTC to psTime */ 65 65 psTime * 66 psUTCToTime (double input) // !< Input UTC time66 psUTCToTime (double input) ///< Input UTC time 67 67 ; 68 68 69 69 /** Convert MJD to psTime */ 70 70 psTime * 71 psMJDToTime (double input) // !< Input MJD time71 psMJDToTime (double input) ///< Input MJD time 72 72 ; 73 73 74 74 /** Convert JD to psTime */ 75 75 psTime * 76 psJDToTime (double input) // !< Input JD time76 psJDToTime (double input) ///< Input JD time 77 77 ; 78 78 79 79 /** Convert timeval to psTime (struct timeval) */ 80 80 psTime * 81 psTimevalToTime (struct timeval *input) // !< Input timeval time81 psTimevalToTime (struct timeval *input) ///< Input timeval time 82 82 ; 83 83 84 84 /** Convert broken-to psTime down time (struct tm) */ 85 85 psTime * 86 psTMtoTime (struct tm *input) // !< Input tm time86 psTMtoTime (struct tm *input) ///< Input tm time 87 87 ; 88 88 -
trunk/archive/pslib/include/psDlist.h
r291 r344 9 9 /** Doubly-linked list element */ 10 10 typedef struct psDlistElem { 11 struct psDlistElem *prev; // !< previous link in list12 struct psDlistElem *next; // !< next link in list13 void *data; // !< real data item11 struct psDlistElem *prev; ///< previous link in list 12 struct psDlistElem *next; ///< next link in list 13 void *data; ///< real data item 14 14 } psDlistElem; 15 15 16 16 /** Doubly-linked list */ 17 17 typedef struct { 18 int n; // !< number of elements on list19 psDlistElem *head; // !< first element on list (may be NULL)20 psDlistElem *tail; // !< last element on list (may be NULL)21 psDlistElem *iter; // !< iteration cursor18 int n; ///< number of elements on list 19 psDlistElem *head; ///< first element on list (may be NULL) 20 psDlistElem *tail; ///< last element on list (may be NULL) 21 psDlistElem *iter; ///< iteration cursor 22 22 } psDlist; 23 23 24 24 /** Special values of index into list */ 25 25 enum { 26 PS_DLIST_HEAD = 0, // !< at head27 PS_DLIST_TAIL = -1, // !< at tail28 PS_DLIST_UNKNOWN = -2, // !< unknown position29 PS_DLIST_PREV = -3, // !< previous element30 PS_DLIST_NEXT = -4 // !< next element26 PS_DLIST_HEAD = 0, ///< at head 27 PS_DLIST_TAIL = -1, ///< at tail 28 PS_DLIST_UNKNOWN = -2, ///< unknown position 29 PS_DLIST_PREV = -3, ///< previous element 30 PS_DLIST_NEXT = -4 ///< next element 31 31 }; 32 32 … … 37 37 38 38 /** Constructor */ 39 psDlist *psDlistAlloc(void *data // !< initial data item; may be NULL39 psDlist *psDlistAlloc(void *data ///< initial data item; may be NULL 40 40 ); 41 41 42 42 /** Destructor */ 43 void psDlistFree(psDlist *list, // !< list to destroy44 void (*elemFree)(void *) // !< destructor for data on list43 void psDlistFree(psDlist *list, ///< list to destroy 44 void (*elemFree)(void *) ///< destructor for data on list 45 45 ); 46 46 … … 48 48 49 49 /** Add to list */ 50 psDlist *psDlistAdd(psDlist *list, // !< list to add to (may be NULL)51 void *data, // !< data item to add52 int where // !< index, PS_DLIST_HEAD, or PS_DLIST_TAIL50 psDlist *psDlistAdd(psDlist *list, ///< list to add to (may be NULL) 51 void *data, ///< data item to add 52 int where ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 53 53 ); 54 54 55 55 /** Append to a list */ 56 psDlist *psDlistAppend(psDlist *list, // !< list to append to (may be NULL)57 void *data // !< data item to add56 psDlist *psDlistAppend(psDlist *list, ///< list to append to (may be NULL) 57 void *data ///< data item to add 58 58 ); 59 59 60 60 /** Remove from a list */ 61 void *psDlistRemove(psDlist *list, // !< list to remove element from62 void *data, // !< data item to remove63 int which // !< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or64 // !< PS_DLIST_PREV61 void *psDlistRemove(psDlist *list, ///< list to remove element from 62 void *data, ///< data item to remove 63 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 64 ///< PS_DLIST_PREV 65 65 ); 66 66 /** Retrieve from a list */ 67 void *psDlistGet(const psDlist *list, // !< list to retrieve element from68 int which // !< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV67 void *psDlistGet(const psDlist *list, ///< list to retrieve element from 68 int which ///< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV 69 69 ); 70 70 … … 72 72 73 73 /** Set the iterator */ 74 void psDlistSetIterator(psDlist *list, // !< list to retrieve element from75 int where, // !< index, PS_DLIST_HEAD, or PS_DLIST_TAIL76 int which // !< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or77 // !< PS_DLIST_PREV74 void psDlistSetIterator(psDlist *list, ///< list to retrieve element from 75 int where, ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 76 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 77 ///< PS_DLIST_PREV 78 78 ); 79 79 80 80 /** Get next element */ 81 void *psDlistGetNext(psDlist *list, // !< list to retrieve element from82 int which // !< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or83 // !< PS_DLIST_PREV81 void *psDlistGetNext(psDlist *list, ///< list to retrieve element from 82 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 83 ///< PS_DLIST_PREV 84 84 ); 85 85 86 86 /** Get previous element */ 87 void *psDlistGetPrev(psDlist *list, // !< list to retrieve element from88 int which // !< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or89 // !< PS_DLIST_PREV87 void *psDlistGetPrev(psDlist *list, ///< list to retrieve element from 88 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 89 ///< PS_DLIST_PREV 90 90 ); 91 91 92 92 /** Convert doubly-linked list to an array */ 93 psVoidPtrArray *psDlistToArray(psDlist *dlist // !< List to convert93 psVoidPtrArray *psDlistToArray(psDlist *dlist ///< List to convert 94 94 ); 95 95 96 96 /** Convert array to a doubly-linked list */ 97 psDlist *psArrayToDlist(psVoidPtrArray *arr // !< Array to convert97 psDlist *psArrayToDlist(psVoidPtrArray *arr ///< Array to convert 98 98 ); 99 99 -
trunk/archive/pslib/include/psFFT.h
r317 r344 16 16 /** Details on FFT implementation (private). Example shown is for FFTW */ 17 17 typedef struct { 18 fftw_plan plan; // !< FFTW plan on how to do the FFT19 char *filename; // !< File name for FFTW plan18 fftw_plan plan; ///< FFTW plan on how to do the FFT 19 char *filename; ///< File name for FFTW plan 20 20 } p_psFFTDetails; 21 21 22 22 /** Fast Fourier Transform */ 23 23 typedef struct { 24 p_psFFTDetails *details; // !< Details on FFT implementation (private)25 int nx, ny; // !< Size in x and y26 float *real; // !< Data in real space: a 2D array using the [nx*y + x] stuff27 void *fourier; // !< Data in fourier space; implementation dependent24 p_psFFTDetails *details; ///< Details on FFT implementation (private) 25 int nx, ny; ///< Size in x and y 26 float *real; ///< Data in real space: a 2D array using the [nx*y + x] stuff 27 void *fourier; ///< Data in fourier space; implementation dependent 28 28 } psFFT; 29 29 30 30 /** Constructor */ 31 31 psFFT * 32 psFFTAlloc(psImage *image // !< Image to transform32 psFFTAlloc(psImage *image ///< Image to transform 33 33 ); 34 34 35 35 /** Constructor for 1D case */ 36 36 psFFT * 37 psFFTAlloc1D(const psFloatArray *arr // !< Array to transform37 psFFTAlloc1D(const psFloatArray *arr ///< Array to transform 38 38 ); 39 39 40 40 /** Destructor. Returns the data in the real space as an image. */ 41 41 psImage * 42 psFFTFree(psImage *out, // !< Image to write the data to, or NULL43 psFFT *restrict fft // !< FFT to destroy42 psFFTFree(psImage *out, ///< Image to write the data to, or NULL 43 psFFT *restrict fft ///< FFT to destroy 44 44 ); 45 45 46 46 /** Forward FFT: from real to fourier space */ 47 47 psFFT * 48 psFFTForward(psFFT *fft // !< FFT to apply (input and output)48 psFFTForward(psFFT *fft ///< FFT to apply (input and output) 49 49 ); 50 50 51 51 /** Reverse FFT: from fourier to real space */ 52 52 psFFT * 53 psFFTReverse(psFFT *fft // !< FFT to apply (input and output)53 psFFTReverse(psFFT *fft ///< FFT to apply (input and output) 54 54 ); 55 55 56 56 /** Apply filter function in fourier space */ 57 57 psFFT * 58 psFFTFilter(psFFT *fft, // !< FFT to use (input and output)59 float (*filterFunc)(int kx, int ky) // !< External filter function58 psFFTFilter(psFFT *fft, ///< FFT to use (input and output) 59 float (*filterFunc)(int kx, int ky) ///< External filter function 60 60 ); 61 61 62 62 /** Apply complex filter function */ 63 63 psFFT * 64 psFFTFilterComplex(psFFT *fft, // !< FFT to use (input and output)65 float (*realFilterFunc)(int kx, int ky), // !< External filter function, real part66 float (*imagFilterFunc)(int kx, int ky) // !< External filter function, imaginary part64 psFFTFilterComplex(psFFT *fft, ///< FFT to use (input and output) 65 float (*realFilterFunc)(int kx, int ky), ///< External filter function, real part 66 float (*imagFilterFunc)(int kx, int ky) ///< External filter function, imaginary part 67 67 ); 68 68 … … 71 71 */ 72 72 psFFT * 73 psFFTCrossCorrelate(psFFT *out // !< Output FFT (or NULL)74 const psFFT *fft1, const psFFT *fft2 // !< FFTs to use in cross-correlation73 psFFTCrossCorrelate(psFFT *out ///< Output FFT (or NULL) 74 const psFFT *fft1, const psFFT *fft2 ///< FFTs to use in cross-correlation 75 75 ); 76 76 77 77 /** Calculate FFT of the convolution. Straight multiplication of the FFTs */ 78 78 psFFT * 79 psFFTConvolve(psFFT *out, // !< Output FFT (or NULL)80 const psFFT *fft1, const psFFT *fft2 // !< FFTs to multiply79 psFFTConvolve(psFFT *out, ///< Output FFT (or NULL) 80 const psFFT *fft1, const psFFT *fft2 ///< FFTs to multiply 81 81 ); 82 82 83 83 /** Calculate power spectrum */ 84 84 psFloatArray * 85 psFFTPowerSpec(psFFT *fft // !< FFT to use (input and output)85 psFFTPowerSpec(psFFT *fft ///< FFT to use (input and output) 86 86 ); 87 87 88 88 /* Convert the real data in the FFT struct to an image again */ 89 89 psImage * 90 psFFTGetImage(psImage *out, // !< Image to write to (or NULL)91 const psFFT *fft // !< FFT to get image from90 psFFTGetImage(psImage *out, ///< Image to write to (or NULL) 91 const psFFT *fft ///< FFT to get image from 92 92 ); 93 93 94 94 /** Convert the Fourier transform data in the FFT struct to an image of complex numbers */ 95 95 psImage * 96 psFFTGetFT(psImage *out, // !< Image to write to (or NULL)97 const psFFT *fft // !< FFT to get Fourier transform from96 psFFTGetFT(psImage *out, ///< Image to write to (or NULL) 97 const psFFT *fft ///< FFT to get Fourier transform from 98 98 ); 99 99 -
trunk/archive/pslib/include/psFunctions.h
r298 r344 10 10 is not a Gaussian deviate. The evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */ 11 11 float 12 psGaussian(float x, // !< Value at which to evaluate13 float mean, // !< Mean for the Gaussian14 float stddev // !< Standard deviation for the Gaussian12 psGaussian(float x, ///< Value at which to evaluate 13 float mean, ///< Mean for the Gaussian 14 float stddev ///< Standard deviation for the Gaussian 15 15 ); 16 16 … … 19 19 /** One-dimensional polynomial */ 20 20 typedef struct { 21 int n; // !< Number of terms22 float *restrict coeff; // !< Coefficients23 float *restrict coeffErr; // !< Error in coefficients24 char *restrict mask; // !< Coefficient mask21 int n; ///< Number of terms 22 float *restrict coeff; ///< Coefficients 23 float *restrict coeffErr; ///< Error in coefficients 24 char *restrict mask; ///< Coefficient mask 25 25 } psPolynomial1D; 26 26 27 27 /** Two-dimensional polynomial */ 28 28 typedef struct { 29 int nX, nY; // !< Number of terms in x and y30 float *restrict *restrict coeff; // !< Coefficients31 float *restrict *restrict coeffErr; // !< Error in coefficients32 char *restrict *restrict mask; // !< Coefficients mask29 int nX, nY; ///< Number of terms in x and y 30 float *restrict *restrict coeff; ///< Coefficients 31 float *restrict *restrict coeffErr; ///< Error in coefficients 32 char *restrict *restrict mask; ///< Coefficients mask 33 33 } psPolynomial2D; 34 34 35 35 /** Three-dimensional polynomial */ 36 36 typedef struct { 37 int nX, nY, nZ; // !< Number of terms in x, y and z38 float *restrict *restrict *restrict coeff; // !< Coefficients39 float *restrict *restrict *restrict coeffErr; // !< Error in coefficients40 char *restrict *restrict *restrict mask; // !< Coefficients mask37 int nX, nY, nZ; ///< Number of terms in x, y and z 38 float *restrict *restrict *restrict coeff; ///< Coefficients 39 float *restrict *restrict *restrict coeffErr; ///< Error in coefficients 40 char *restrict *restrict *restrict mask; ///< Coefficients mask 41 41 } psPolynomial3D; 42 42 43 43 /** Four-dimensional polynomial */ 44 44 typedef struct { 45 int nW, nX, nY, nZ; // !< Number of terms in w, x, y and z46 float *restrict *restrict *restrict *restrict coeff; // !< Coefficients47 float *restrict *restrict *restrict *restrict coeffErr; // !< Error in coefficients48 char *restrict *restrict *restrict *restrict mask; // !< Coefficients mask45 int nW, nX, nY, nZ; ///< Number of terms in w, x, y and z 46 float *restrict *restrict *restrict *restrict coeff; ///< Coefficients 47 float *restrict *restrict *restrict *restrict coeffErr; ///< Error in coefficients 48 char *restrict *restrict *restrict *restrict mask; ///< Coefficients mask 49 49 } psPolynomial4D; 50 50 … … 56 56 57 57 /** Constructor */ 58 psPolynomial1D *psPolynomial1DAlloc(int n // !< Number of terms59 ); 60 /** Constructor */ 61 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY // !< Number of terms in x and y62 ); 63 /** Constructor */ 64 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ // !< Number of terms in x, y and z65 ); 66 /** Constructor */ 67 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ // !< Number of terms in w, x, y and z68 ); 69 70 /** Destructor */ 71 void psPolynomial1DFree(psPolynomial1D *restrict myPoly // !< Polynomial to destroy58 psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms 59 ); 60 /** Constructor */ 61 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 62 ); 63 /** Constructor */ 64 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 65 ); 66 /** Constructor */ 67 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z 68 ); 69 70 /** Destructor */ 71 void psPolynomial1DFree(psPolynomial1D *restrict myPoly ///< Polynomial to destroy 72 72 ); 73 73 74 74 /** Destructor */ 75 void psPolynomial2DFree(psPolynomial2D *restrict myPoly // !< Polynomial to destroy76 ); 77 /** Destructor */ 78 void psPolynomial3DFree(psPolynomial3D *restrict myPoly // !< Polynomial to destroy79 ); 80 /** Destructor */ 81 void psPolynomial4DFree(psPolynomial4D *restrict myPoly // !< Polynomial to destroy75 void psPolynomial2DFree(psPolynomial2D *restrict myPoly ///< Polynomial to destroy 76 ); 77 /** Destructor */ 78 void psPolynomial3DFree(psPolynomial3D *restrict myPoly ///< Polynomial to destroy 79 ); 80 /** Destructor */ 81 void psPolynomial4DFree(psPolynomial4D *restrict myPoly ///< Polynomial to destroy 82 82 ); 83 83 84 84 /** Evaluate 1D polynomial */ 85 85 float 86 psEvalPolynomial1D(float x, // !< Value at which to evaluate87 const psPolynomial1D *restrict myPoly // !< Coefficients for the polynomial86 psEvalPolynomial1D(float x, ///< Value at which to evaluate 87 const psPolynomial1D *restrict myPoly ///< Coefficients for the polynomial 88 88 ); 89 89 90 90 /** Evaluate 2D polynomial */ 91 91 float 92 psEvalPolynomial2D(float x, // !< Value x at which to evaluate93 float y, // !< Value y at which to evaluate94 const psPolynomial2D *restrict myPoly // !< Coefficients for the polynomial92 psEvalPolynomial2D(float x, ///< Value x at which to evaluate 93 float y, ///< Value y at which to evaluate 94 const psPolynomial2D *restrict myPoly ///< Coefficients for the polynomial 95 95 ); 96 96 97 97 /** Evaluate 3D polynomial */ 98 98 float 99 psEvalPolynomial3D(float x, // !< Value x at which to evaluate100 float y, // !< Value y at which to evaluate101 float z, // !< Value z at which to evaluate102 const psPolynomial3D *restrict myPoly // !< Coefficients for the polynomial99 psEvalPolynomial3D(float x, ///< Value x at which to evaluate 100 float y, ///< Value y at which to evaluate 101 float z, ///< Value z at which to evaluate 102 const psPolynomial3D *restrict myPoly ///< Coefficients for the polynomial 103 103 ); 104 104 105 105 /** Evaluate 4D polynomial */ 106 106 float 107 psEvalPolynomial4D(float w, // !< Value w at which to evaluate108 float x, // !< Value x at which to evaluate109 float y, // !< Value y at which to evaluate110 float z, // !< Value z at which to evaluate111 const psPolynomial4D *restrict myPoly // !< Coefficients for the polynomial107 psEvalPolynomial4D(float w, ///< Value w at which to evaluate 108 float x, ///< Value x at which to evaluate 109 float y, ///< Value y at which to evaluate 110 float z, ///< Value z at which to evaluate 111 const psPolynomial4D *restrict myPoly ///< Coefficients for the polynomial 112 112 ); 113 113 … … 120 120 /** Double-precision one-dimensional polynomial */ 121 121 typedef struct { 122 int n; // !< Number of terms123 double *restrict coeff; // !< Coefficients124 double *restrict coeffErr; // !< Error in coefficients125 char *restrict mask; // !< Coefficient mask122 int n; ///< Number of terms 123 double *restrict coeff; ///< Coefficients 124 double *restrict coeffErr; ///< Error in coefficients 125 char *restrict mask; ///< Coefficient mask 126 126 } psDPolynomial1D; 127 127 128 128 /** Double-precision two-dimensional polynomial */ 129 129 typedef struct { 130 int nX, nY; // !< Number of terms in x and y131 double *restrict *restrict coeff; // !< Coefficients132 double *restrict *restrict coeffErr; // !< Error in coefficients133 char *restrict *restrict mask; // !< Coefficients mask130 int nX, nY; ///< Number of terms in x and y 131 double *restrict *restrict coeff; ///< Coefficients 132 double *restrict *restrict coeffErr; ///< Error in coefficients 133 char *restrict *restrict mask; ///< Coefficients mask 134 134 } psDPolynomial2D; 135 135 136 136 /** Double-precision three-dimensional polynomial */ 137 137 typedef struct { 138 int nX, nY, nZ; // !< Number of terms in x, y and z139 double *restrict *restrict *restrict coeff; // !< Coefficients140 double *restrict *restrict *restrict coeffErr; // !< Error in coefficients141 char *restrict *restrict *restrict mask; // !< Coefficient mask138 int nX, nY, nZ; ///< Number of terms in x, y and z 139 double *restrict *restrict *restrict coeff; ///< Coefficients 140 double *restrict *restrict *restrict coeffErr; ///< Error in coefficients 141 char *restrict *restrict *restrict mask; ///< Coefficient mask 142 142 } psDPolynomial3D; 143 143 144 144 /** Double-precision four-dimensional polynomial */ 145 145 typedef struct { 146 int nW, nX, nY, nZ; // !< Number of terms in w, x, y and z147 double *restrict *restrict *restrict *restrict coeff; // !< Coefficients148 double *restrict *restrict *restrict *restrict coeffErr; // !< Error in coefficients149 char *restrict *restrict *restrict *restrict mask; // !< Coefficients mask146 int nW, nX, nY, nZ; ///< Number of terms in w, x, y and z 147 double *restrict *restrict *restrict *restrict coeff; ///< Coefficients 148 double *restrict *restrict *restrict *restrict coeffErr; ///< Error in coefficients 149 char *restrict *restrict *restrict *restrict mask; ///< Coefficients mask 150 150 } psDPolynomial4D; 151 151 … … 156 156 157 157 /** Constructor */ 158 psDPolynomial1D *psDPolynomial1DAlloc(int n // !< Number of terms159 ); 160 /** Constructor */ 161 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY // !< Number of terms in x and y162 ); 163 /** Constructor */ 164 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ // !< Number of terms in x, y and z165 ); 166 /** Constructor */ 167 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ // !< Number of terms in w, x, y and z168 ); 169 170 171 /** Destructor */ 172 void psDPolynomial1DFree(psDPolynomial1D *restrict myPoly // !< Polynomial to destroy173 ); 174 /** Destructor */ 175 void psDPolynomial2DFree(psDPolynomial2D *restrict myPoly // !< Polynomial to destroy176 ); 177 /** Destructor */ 178 void psDPolynomial3DFree(psDPolynomial3D *restrict myPoly // !< Polynomial to destroy179 ); 180 /** Destructor */ 181 void psDPolynomial4DFree(psDPolynomial4D *restrict myPoly // !< Polynomial to destroy158 psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms 159 ); 160 /** Constructor */ 161 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 162 ); 163 /** Constructor */ 164 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 165 ); 166 /** Constructor */ 167 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z 168 ); 169 170 171 /** Destructor */ 172 void psDPolynomial1DFree(psDPolynomial1D *restrict myPoly ///< Polynomial to destroy 173 ); 174 /** Destructor */ 175 void psDPolynomial2DFree(psDPolynomial2D *restrict myPoly ///< Polynomial to destroy 176 ); 177 /** Destructor */ 178 void psDPolynomial3DFree(psDPolynomial3D *restrict myPoly ///< Polynomial to destroy 179 ); 180 /** Destructor */ 181 void psDPolynomial4DFree(psDPolynomial4D *restrict myPoly ///< Polynomial to destroy 182 182 ); 183 183 … … 185 185 /** Evaluate 1D polynomial (double precision) */ 186 186 double 187 psEvalDPolynomial1D(double x, // !< Value at which to evaluate188 const psDPolynomial1D *restrict myPoly // !< Coefficients for the polynomial187 psEvalDPolynomial1D(double x, ///< Value at which to evaluate 188 const psDPolynomial1D *restrict myPoly ///< Coefficients for the polynomial 189 189 ); 190 190 191 191 /** Evaluate 2D polynomial (double precision) */ 192 192 double 193 psEvalDPolynomial2D(double x, // !< Value x at which to evaluate194 double y, // !< Value y at which to evaluate195 const psDPolynomial2D *restrict myPoly // !< Coefficients for the polynomial193 psEvalDPolynomial2D(double x, ///< Value x at which to evaluate 194 double y, ///< Value y at which to evaluate 195 const psDPolynomial2D *restrict myPoly ///< Coefficients for the polynomial 196 196 ); 197 197 198 198 /** Evaluate 3D polynomial (double precision) */ 199 199 double 200 psEvalDPolynomial3D(double x, // !< Value x at which to evaluate201 double y, // !< Value y at which to evaluate202 double z, // !< Value z at which to evaluate203 const psDPolynomial3D *restrict myPoly // !< Coefficients for the polynomial200 psEvalDPolynomial3D(double x, ///< Value x at which to evaluate 201 double y, ///< Value y at which to evaluate 202 double z, ///< Value z at which to evaluate 203 const psDPolynomial3D *restrict myPoly ///< Coefficients for the polynomial 204 204 ); 205 205 206 206 /** Evaluate 4D polynomial (double precision) */ 207 207 double 208 psEvalDPolynomial4D(double w, // !< Value w at which to evaluate209 double x, // !< Value x at which to evaluate210 double y, // !< Value y at which to evaluate211 double z, // !< Value z at which to evaluate212 const psDPolynomial4D *restrict myPoly // !< Coefficients for the polynomial208 psEvalDPolynomial4D(double w, ///< Value w at which to evaluate 209 double x, ///< Value x at which to evaluate 210 double y, ///< Value y at which to evaluate 211 double z, ///< Value z at which to evaluate 212 const psDPolynomial4D *restrict myPoly ///< Coefficients for the polynomial 213 213 ); 214 214 -
trunk/archive/pslib/include/psImage.h
r292 r344 22 22 psF32 **rows_f32; ///< pointers to psF32 data 23 23 psF64 **rows_f64; ///< pointers to psF64 data 24 psComplex **rows_complex; // !< pointers to psComplex data24 psComplex **rows_complex; ///< pointers to psComplex data 25 25 } rows; 26 26 psImage *parent; ///< parent, if a subimage … … 45 45 /// Create a subimage of the specified area. 46 46 psImage * 47 psImageSubset(psImage *out, // !< Subimage to return, or NULL47 psImageSubset(psImage *out, ///< Subimage to return, or NULL 48 48 const psImage *image, ///< parent image 49 49 int nx, ///< subimage width (<= image.nx - x0) … … 60 60 /** Destroy the pixels of the specified image */ 61 61 psImage * 62 psImageFreePixels(psImage *restrict image // !< Image whose pixels are to be freed62 psImageFreePixels(psImage *restrict image ///< Image whose pixels are to be freed 63 63 ); 64 64 … … 78 78 /// Extract pixels from rectlinear region to a vector. 79 79 psFloatArray * 80 psImageSlice(psFloatArray *out, // !< Vector to output, or NULL80 psImageSlice(psFloatArray *out, ///< Vector to output, or NULL 81 81 const psImage *input, ///< extract slice from this image 82 82 int x, ///< starting x coord of region to slice … … 90 90 /// Extract pixels along a line to a vector. 91 91 psFloatArray * 92 psImageCut(psFloatArray *out, // !< Vector to output, or NULL92 psImageCut(psFloatArray *out, ///< Vector to output, or NULL 93 93 const psImage *input, ///< extract cut from this image 94 94 float xs, ///< starting x coord of cut … … 102 102 /// Extract radial annulii data to a vector. 103 103 psFloatArray * 104 psImageRadialCut(psFloatArray *out, // !< Vector to output, or NULL104 psImageRadialCut(psFloatArray *out, ///< Vector to output, or NULL 105 105 const psImage *input, ///< extract profile from this image 106 106 float x, ///< center x coord of annulii … … 115 115 /// Extract a 2-d contour from an image at the given threshold. 116 116 psFloatArray * 117 psImageContour(psFloatArray *out, // !< Vector to output, or NULL117 psImageContour(psFloatArray *out, ///< Vector to output, or NULL 118 118 const psImage *input, ///< create contour for this image 119 119 float threshold, ///< contour image at this threshold … … 125 125 /// Rebin image to new scale. 126 126 psImage * 127 psImageRebin(psImage *out, // !< Image to output, or NULL127 psImageRebin(psImage *out, ///< Image to output, or NULL 128 128 const psImage *input, ///< rebin this image 129 129 float scale, ///< rebinning scale: doutput = scale*dinput … … 133 133 /// Rotate image by given angle. 134 134 psImage * 135 psImageRotate(psImage *out, // !< Image to output, or NULL135 psImageRotate(psImage *out, ///< Image to output, or NULL 136 136 const psImage *input, ///< rotate this image 137 137 float angle ///< rotate by this amount anti-clockwise (degrees) … … 141 141 /// Drop edge pixels, and set newly exposed pixels to 'exposed'. 142 142 psImage * 143 psImageShift(psImage *out, // !< Image to output, or NULL143 psImageShift(psImage *out, ///< Image to output, or NULL 144 144 const psImage *input, ///< shift this image 145 145 float dx, ///< shift by this amount in x … … 151 151 /// Edge pixels wrap to the other side (no values are lost). 152 152 psImage * 153 psImageRoll(psImage *out, // !< Image to output, or NULL153 psImageRoll(psImage *out, ///< Image to output, or NULL 154 154 const psImage *input, ///< roll this image 155 155 int dx, ///< roll this amount in x … … 249 249 /// Perform an FFT on the image. The output image type is psComplex. 250 250 psImage * 251 psImageFFT(psImage *output, // !< Output image251 psImageFFT(psImage *output, ///< Output image 252 252 const psImage *input, ///< image to FFT 253 253 int direction ///< FFT direction -
trunk/archive/pslib/include/psLogMsg.h
r325 r344 31 31 /* \} */ // End of SystemGroup Functions 32 32 33 enum { PS_LOG_ABORT = 0, PS_LOG_ERROR, PS_LOG_WARN, PS_LOG_INFO }; // !< Status codes for log messages33 enum { PS_LOG_ABORT = 0, PS_LOG_ERROR, PS_LOG_WARN, PS_LOG_INFO }; ///< Status codes for log messages 34 34 35 enum { PS_LOG_NONE, PS_LOG_TO_STDERR, PS_LOG_TO_STDOUT }; // !< Destinations for log messages35 enum { PS_LOG_NONE, PS_LOG_TO_STDERR, PS_LOG_TO_STDOUT }; ///< Destinations for log messages 36 36 37 37 #endif -
trunk/archive/pslib/include/psMatrix.h
r340 r344 17 17 /** Invert matrix. Not using restrict, to allow inversion to be done in-place */ 18 18 psImage * 19 psMatrixInvert(psImage *out, // !< Matrix to return, or NULL20 const psImage *myMatrix, // !< Matrix to be inverted21 float *restrict determinant // !< Determinant to return, or NULL19 psMatrixInvert(psImage *out, ///< Matrix to return, or NULL 20 const psImage *myMatrix, ///< Matrix to be inverted 21 float *restrict determinant ///< Determinant to return, or NULL 22 22 ); 23 23 24 24 /** Matrix determinant */ 25 25 float 26 psMatrixDeterminant(const psImage *restrict myMatrix // !< Matrix to get determinant for26 psMatrixDeterminant(const psImage *restrict myMatrix ///< Matrix to get determinant for 27 27 ); 28 28 29 29 /** Matrix operation: addition, subtraction, multiplication */ 30 30 psImage * 31 psMatrixOp(psImage *out, // !< Matrix to return, or NULL32 const psImage *matrix1, // !< Matrix 133 const psImage *matrix2 // !< Matrix 231 psMatrixOp(psImage *out, ///< Matrix to return, or NULL 32 const psImage *matrix1, ///< Matrix 1 33 const psImage *matrix2 ///< Matrix 2 34 34 ); 35 35 36 36 /** Transpose Matrix */ 37 37 psImage * 38 psMatrixTranspose(psImage *out, // !< Matrix to return, or NULL39 const psImage *myMatrix // !< Matrix to transpose38 psMatrixTranspose(psImage *out, ///< Matrix to return, or NULL 39 const psImage *myMatrix ///< Matrix to transpose 40 40 ); 41 41 … … 46 46 /** Convert matrix to vector. Intended for a 1-d matrix. */ 47 47 psVector * 48 psMatrixToVector(psVector *out, // !< Vector to return, or NULL49 psImage *myMatrix // !< Matrix to convert48 psMatrixToVector(psVector *out, ///< Vector to return, or NULL 49 psImage *myMatrix ///< Matrix to convert 50 50 ); 51 51 52 52 /** Convert vector to matrix. */ 53 53 psImage * 54 psVectorToMatrix(psImage *out, // !< Matrix to return, or NULL55 psVector *myVector // !< Vector to convert54 psVectorToMatrix(psImage *out, ///< Matrix to return, or NULL 55 psVector *myVector ///< Vector to convert 56 56 ); 57 57 -
trunk/archive/pslib/include/psMemory.h
r326 r344 16 16 */ 17 17 typedef struct { 18 const void *magic0; // !< initialised to p_psMEMMAGIC19 const unsigned long id; // !< a unique ID for this allocation20 const char *file; // !< set from __FILE__ in e.g. p_psAlloc21 const int lineno; // !< set from __LINE__ in e.g. p_psAlloc22 int refCounter; // !< how many times pointer is referenced23 const void *magic; // !< initialised to p_psMEMMAGIC18 const void *magic0; ///< initialised to p_psMEMMAGIC 19 const unsigned long id; ///< a unique ID for this allocation 20 const char *file; ///< set from __FILE__ in e.g. p_psAlloc 21 const int lineno; ///< set from __LINE__ in e.g. p_psAlloc 22 int refCounter; ///< how many times pointer is referenced 23 const void *magic; ///< initialised to p_psMEMMAGIC 24 24 } psMemBlock; 25 25 … … 39 39 40 40 /// Memory allocation. Underlying private function called by macro psAlloc. 41 void *p_psAlloc(size_t size, // !< Size required42 const char *file, // !< File of call43 int lineno // !< Line number of call41 void *p_psAlloc(size_t size, ///< Size required 42 const char *file, ///< File of call 43 int lineno ///< Line number of call 44 44 ); 45 45 46 46 /// Memory re-allocation. Underlying private function called by macro psRealloc. 47 void *p_psRealloc(void *ptr, // !< Pointer to re-allocate48 size_t size, // !< Size required49 const char *file, // !< File of call50 int lineno // !< Line number of call47 void *p_psRealloc(void *ptr, ///< Pointer to re-allocate 48 size_t size, ///< Size required 49 const char *file, ///< File of call 50 int lineno ///< Line number of call 51 51 ); 52 52 53 53 /// Free memory. Underlying private function called by macro psFree. 54 void p_psFree(void *ptr, // !< Pointer to free55 const char *file, // !< File of call56 int lineno // !< Line number of call54 void p_psFree(void *ptr, ///< Pointer to free 55 const char *file, ///< File of call 56 int lineno ///< Line number of call 57 57 ); 58 58 59 59 /// Check for memory leaks 60 int psMemCheckLeaks(int id0, // !< don't list blocks with id < id061 psMemBlock ***arr, // !< pointer to array of pointers to leaked blocks, or NULL62 FILE *fd // !< print list of leaks to fd (or NULL)60 int psMemCheckLeaks(int id0, ///< don't list blocks with id < id0 61 psMemBlock ***arr, ///< pointer to array of pointers to leaked blocks, or NULL 62 FILE *fd ///< print list of leaks to fd (or NULL) 63 63 ); 64 64 65 65 /// Check for memory corruption 66 int psMemCheckCorruption(int abort_on_error // !< Abort on detecting corruption?66 int psMemCheckCorruption(int abort_on_error ///< Abort on detecting corruption? 67 67 ); 68 68 69 69 /// Return reference counter 70 int psMemGetRefCounter(void *vptr // !< Pointer to get refCounter for70 int psMemGetRefCounter(void *vptr ///< Pointer to get refCounter for 71 71 ); 72 72 73 73 /// Increment reference counter and return the pointer 74 void *psMemIncrRefCounter(void *vptr // !< Pointer to increment refCounter, and return74 void *psMemIncrRefCounter(void *vptr ///< Pointer to increment refCounter, and return 75 75 ); 76 76 77 77 /// Decrement reference counter and return the pointer 78 void *psMemDecrRefCounter(void *vptr // !< Pointer to decrement refCounter, and return78 void *psMemDecrRefCounter(void *vptr ///< Pointer to decrement refCounter, and return 79 79 ); 80 80 81 81 /// Set callback for problems 82 psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func // !< Function to run82 psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func ///< Function to run 83 83 ); 84 84 85 85 /// Set callback for out-of-memory 86 psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func // !< Function to run86 psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func ///< Function to run 87 87 ); 88 88 89 89 /// Set call back for when a particular memory block is allocated 90 psMemCallback psMemAllocateSetCB(psMemCallback func // !< Function to run90 psMemCallback psMemAllocateSetCB(psMemCallback func ///< Function to run 91 91 ); 92 92 … … 99 99 100 100 /// set p_psMemAllocateID to id 101 long psMemSetAllocateID(long id // !< ID to set101 long psMemSetAllocateID(long id ///< ID to set 102 102 ); 103 103 104 104 /// set p_psMemFreeID to id 105 long psMemSetFreeID(long id // !< ID to set105 long psMemSetFreeID(long id ///< ID to set 106 106 ); 107 107 -
trunk/archive/pslib/include/psMetaData.h
r294 r344 8 8 9 9 /** Possible types of metadata. */ 10 typedef enum { // !< type of val is:11 PS_META_ITEM_SET = 0, // !< NULL; metadata is in psMetaDataType.items12 PS_META_FLOAT, // !< float (.f)13 PS_META_INT, // !< int (.i)14 PS_META_STR, // !< string (.v)15 PS_META_IMG, // !< image (.v)16 PS_META_JPEG, // !< JPEG (.v)17 PS_META_PNG, // !< PNG (.v)18 PS_META_ASTROM, // !< astrometric coefficients (.v)19 PS_META_UNKNOWN, // !< other (.v)20 PS_META_NTYPE // !< Number of types; must be last10 typedef enum { ///< type of val is: 11 PS_META_ITEM_SET = 0, ///< NULL; metadata is in psMetaDataType.items 12 PS_META_FLOAT, ///< float (.f) 13 PS_META_INT, ///< int (.i) 14 PS_META_STR, ///< string (.v) 15 PS_META_IMG, ///< image (.v) 16 PS_META_JPEG, ///< JPEG (.v) 17 PS_META_PNG, ///< PNG (.v) 18 PS_META_ASTROM, ///< astrometric coefficients (.v) 19 PS_META_UNKNOWN, ///< other (.v) 20 PS_META_NTYPE ///< Number of types; must be last 21 21 } psMetaDataType; 22 22 23 23 /** Metadata flags (not exclusive with psMetaDataType). */ 24 24 typedef enum { 25 PS_META_TYPE_MASK = 0xffff, // !< the type enum must fit in this mask26 PS_META_UNIQUE = 0x10000, // !< the name must be unique (default)27 PS_META_NON_UNIQUE = 0x20000, // !< the name may be repeated, and should be disambiguated for us25 PS_META_TYPE_MASK = 0xffff, ///< the type enum must fit in this mask 26 PS_META_UNIQUE = 0x10000, ///< the name must be unique (default) 27 PS_META_NON_UNIQUE = 0x20000, ///< the name may be repeated, and should be disambiguated for us 28 28 } psMetaDataFlags; 29 29 30 30 /** A struct to define a single item of metadata */ 31 31 typedef struct { 32 const int id; // !< unique ID for this item33 char *restrict name; // !< Name of item34 psMetaDataType type; // !< type of this item35 psMetaDataFlags flags; // !< flags associated with this item32 const int id; ///< unique ID for this item 33 char *restrict name; ///< Name of item 34 psMetaDataType type; ///< type of this item 35 psMetaDataFlags flags; ///< flags associated with this item 36 36 const union { 37 float f; // !< floating value38 int i; // !< integer value39 void *v; // !< other type40 } val; // !< value of metadata41 char *comment; // !< optional comment ("", not NULL)42 psDlist *restrict items; // !< list of psMetaDataItems with the same name37 float f; ///< floating value 38 int i; ///< integer value 39 void *v; ///< other type 40 } val; ///< value of metadata 41 char *comment; ///< optional comment ("", not NULL) 42 psDlist *restrict items; ///< list of psMetaDataItems with the same name 43 43 } psMetaDataItem; 44 44 45 45 /** A set of metadata */ 46 46 typedef struct { 47 psDlist *restrict list; // !< list of psMetaDataItem48 psHash *restrict table; // !< hash table of the same metadata47 psDlist *restrict list; ///< list of psMetaDataItem 48 psHash *restrict table; ///< hash table of the same metadata 49 49 } psMetaDataSet; 50 50 … … 55 55 56 56 /** Constructor */ 57 psMetaDataItem *psMetaDataItemAlloc(int typeFlags, // !< type of this piece of metadata + flags58 const void *val, // !< value of new item N.b. a pointer even if the item59 // !< is of type e.g. int60 const char *comment, // !< comment associated with item61 const char *name, // !< name of new item of metadata (may be in sprintf62 // !< format)63 ... // !< possible arguments for name format57 psMetaDataItem *psMetaDataItemAlloc(int typeFlags, ///< type of this piece of metadata + flags 58 const void *val, ///< value of new item N.b. a pointer even if the item 59 ///< is of type e.g. int 60 const char *comment, ///< comment associated with item 61 const char *name, ///< name of new item of metadata (may be in sprintf 62 ///< format) 63 ... ///< possible arguments for name format 64 64 ); 65 65 66 66 /** Destructor */ 67 void psMetaDataItemFree(psMetaDataItem *ms // !< piece of metadata to destroy67 void psMetaDataItemFree(psMetaDataItem *ms ///< piece of metadata to destroy 68 68 ); 69 69 /** Constructor */ 70 psMetaDataSet *psMetaDataSetAlloc(void); // !< make a new set of metadata70 psMetaDataSet *psMetaDataSetAlloc(void); ///< make a new set of metadata 71 71 72 72 /** Destructor */ 73 void psMetaDataSetFree(psMetaDataSet *ms // !< destroy a set of metadata73 void psMetaDataSetFree(psMetaDataSet *ms ///< destroy a set of metadata 74 74 ); 75 75 … … 77 77 78 78 /// Add entry to the end of the metadata set 79 psMetaDataItem *psMetaDataAppend(psMetaDataSet *restrict ms, // !< Metadata set to add to80 psMetaDataItem *restrict item // !< Metatdata to add79 psMetaDataItem *psMetaDataAppend(psMetaDataSet *restrict ms, ///< Metadata set to add to 80 psMetaDataItem *restrict item ///< Metatdata to add 81 81 ); 82 82 83 83 /// delete entry from the metadata set 84 psMetaDataItem *psMetaDataRemove(psMetaDataSet *restrict ms, // !< Metadata set to delete from85 const char *restrict key // !< Key to delete84 psMetaDataItem *psMetaDataRemove(psMetaDataSet *restrict ms, ///< Metadata set to delete from 85 const char *restrict key ///< Key to delete 86 86 ); 87 87 88 88 /// reset the iterator to the start of the list 89 void psMetaDataSetIterator(psMetaDataSet *ms // !< Metadata set to set iterator for89 void psMetaDataSetIterator(psMetaDataSet *ms ///< Metadata set to set iterator for 90 90 ); 91 91 92 92 /// get the next entry in the sequence 93 psMetaDataItem *psMetaDataGetNext(psMetaDataSet *restrict ms, // !< Metadata set to get from94 const char *restrict match // !< Match this93 psMetaDataItem *psMetaDataGetNext(psMetaDataSet *restrict ms, ///< Metadata set to get from 94 const char *restrict match ///< Match this 95 95 ); 96 96 97 97 /// find the metadata with the specified key 98 psMetaDataItem *psMetaDataLookup(const psMetaDataSet *restrict ms, // !< Metadata set to look up99 const char *restrict key // !< Key to find98 psMetaDataItem *psMetaDataLookup(const psMetaDataSet *restrict ms, ///< Metadata set to look up 99 const char *restrict key ///< Key to find 100 100 ); 101 101 102 102 /// print metadata item to the specified stream 103 void psMetaDataItemPrint(FILE *fd, // !< file descriptor to write to104 const psMetaDataItem *restrict ms, // !< item of metadata to print105 const char *prefix // !< print this at the beginning of each line103 void psMetaDataItemPrint(FILE *fd, ///< file descriptor to write to 104 const psMetaDataItem *restrict ms, ///< item of metadata to print 105 const char *prefix ///< print this at the beginning of each line 106 106 ); 107 107 /* \} */ // End of AstroGroup Functions -
trunk/archive/pslib/include/psMinimize.h
r336 r344 14 14 /** Minimize a particular non-linear function */ 15 15 psFloatArray * 16 psMinimize(float (*myFunction)(const psFloatArray *restrict), // !< Function to minimize17 psFloatArray *restrict initialGuess // !< Initial guess16 psMinimize(float (*myFunction)(const psFloatArray *restrict), ///< Function to minimize 17 psFloatArray *restrict initialGuess ///< Initial guess 18 18 ); 19 19 … … 22 22 psFloatArray * 23 23 psMinimizeChi2(float (*evalModel)(const psFloatArray *restrict, 24 const psFloatArray *restrict), // !< Model to fit; (domain and params)25 const psFloatArray *restrict domain, // !< The domain values for the corresponding measurements26 const psFloatArray *restrict data, // !< Data to fit27 const psFloatArray *restrict errors, // !< Errors in the data28 psFloatArray *restrict initialGuess, // !< Initial guess29 const psIntArray *restrict guessMask // !< 1 = fit for parameter, 0 = hold parameter constant24 const psFloatArray *restrict), ///< Model to fit; (domain and params) 25 const psFloatArray *restrict domain, ///< The domain values for the corresponding measurements 26 const psFloatArray *restrict data, ///< Data to fit 27 const psFloatArray *restrict errors, ///< Errors in the data 28 psFloatArray *restrict initialGuess, ///< Initial guess 29 const psIntArray *restrict guessMask ///< 1 = fit for parameter, 0 = hold parameter constant 30 30 ); 31 31 32 32 /** Derive a polynomial fit by chi^2 minimisation --- can be done analytically */ 33 33 psPolynomial1D * 34 psGetArrayPolynomial(psPolynomial1D myPoly, // !< Polynomial to fit35 const psFloatArray *restrict x, // !< Ordinates (or NULL to just use the indices)36 const psFloatArray *restrict y, // !< Coordinates37 const psFloatArray *restrict yErr // !< Errors in coordinates, or NULL34 psGetArrayPolynomial(psPolynomial1D myPoly, ///< Polynomial to fit 35 const psFloatArray *restrict x, ///< Ordinates (or NULL to just use the indices) 36 const psFloatArray *restrict y, ///< Coordinates 37 const psFloatArray *restrict yErr ///< Errors in coordinates, or NULL 38 38 ); 39 39 -
trunk/archive/pslib/include/psMisc.h
r327 r344 24 24 /// Allocates nChar and returns a copy of the string or segment 25 25 char *psStringNCopy(const char *str, ///< string to copy 26 int nChar // !< Number of characters (including \0 )26 int nChar ///< Number of characters (including \0 ) 27 27 ); 28 28 -
trunk/archive/pslib/include/psObject.h
r251 r344 11 11 /** Object definition, to handle both objects we detect, and catalogues */ 12 12 typedef struct { 13 psCoord *cell; // !< Centre position on Cell, with associated error14 psCoord *sky; // !< Position on the sky, with associated error15 float mag, magErr; // !< Magnitude and associated error16 float isoMag, isoMagErr; // !< Isophotal magnitude and associated error17 float fwhm, fwhmErr; // !< FWHM and associated error18 float ellipA, ellipB; // !< Elliptical semi-major (A) and semi-minor (B) axes19 float ellipAngle; // !< Ellipse position angle20 float sky, skyErr; // !< Local sky level, and associated error21 float colour, colourErr; // !< Colour and associated error, if known22 psPhotSysrem colorPlus, colorMinus; // !< Colour reference23 psBitMask *quality; // !< Bit mask for quality information13 psCoord *cell; ///< Centre position on Cell, with associated error 14 psCoord *sky; ///< Position on the sky, with associated error 15 float mag, magErr; ///< Magnitude and associated error 16 float isoMag, isoMagErr; ///< Isophotal magnitude and associated error 17 float fwhm, fwhmErr; ///< FWHM and associated error 18 float ellipA, ellipB; ///< Elliptical semi-major (A) and semi-minor (B) axes 19 float ellipAngle; ///< Ellipse position angle 20 float sky, skyErr; ///< Local sky level, and associated error 21 float colour, colourErr; ///< Colour and associated error, if known 22 psPhotSysrem colorPlus, colorMinus; ///< Colour reference 23 psBitMask *quality; ///< Bit mask for quality information 24 24 psCell *parentCell; ///< Cell this measurement came from 25 25 } psObject; … … 37 37 /** An assembly of objects */ 38 38 typedef struct { 39 psType type; // !< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!40 int size; // !< Total number of elements available41 int n; // !< Number of elements in use42 psObject *arr; // !< The array data39 psType type; ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT! 40 int size; ///< Total number of elements available 41 int n; ///< Number of elements in use 42 psObject *arr; ///< The array data 43 43 } psObjectArray; 44 44 45 45 /** Constructor */ 46 psObjectArray *psObjectArrayAlloc(int s, // !< Total number of elements to make available47 int n // !< Number of elements that will be used46 psObjectArray *psObjectArrayAlloc(int s, ///< Total number of elements to make available 47 int n ///< Number of elements that will be used 48 48 ); 49 49 /** Reallocator */ 50 psObjectArray *psObjectArrayRealloc(psObjectArray *myArray, // !< Array to reallocate51 int s // !< Total number of elements to make available50 psObjectArray *psObjectArrayRealloc(psObjectArray *myArray, ///< Array to reallocate 51 int s ///< Total number of elements to make available 52 52 ); 53 53 /** Destructor */ 54 void psObjectArrayFree(psObjectArray *restrict myArray // !< Array to free54 void psObjectArrayFree(psObjectArray *restrict myArray ///< Array to free 55 55 ); 56 56 … … 59 59 /** Associates objects on an image with the image */ 60 60 typedef struct { 61 const struct psImage *image; // !< Image that produced the objects, which has metadata we need62 psObjectArray *objects; // !< The objects61 const struct psImage *image; ///< Image that produced the objects, which has metadata we need 62 psObjectArray *objects; ///< The objects 63 63 } psImageObjects; 64 64 65 65 /** Constructor */ 66 66 psImageObjects * 67 psImageObjectsAlloc(const struct psImage *image, // !< Image that produced the objects, with needed metadata68 psObjectArray *objects // !< The objects67 psImageObjectsAlloc(const struct psImage *image, ///< Image that produced the objects, with needed metadata 68 psObjectArray *objects ///< The objects 69 69 ); 70 70 71 71 /** Destructor */ 72 72 void 73 psImageObjectsFree(psImageObjects *restrict myImageObjects // !< Object to destroy73 psImageObjectsFree(psImageObjects *restrict myImageObjects ///< Object to destroy 74 74 ); 75 75 … … 78 78 /** Objects from a catalogue */ 79 79 typedef struct { 80 psCatalogue catalogue; // !< Source catalogue from which objects come81 psObjectArray *object; // !< The objects80 psCatalogue catalogue; ///< Source catalogue from which objects come 81 psObjectArray *object; ///< The objects 82 82 } psCatalogueObjects; 83 83 84 84 /** Constructor */ 85 85 psCatalogueObjects * 86 psCatalogueObjectsAlloc(enum psCatalogue *catalogue, // !< Source catalogue87 psObjectArray *objects // !< The objects86 psCatalogueObjectsAlloc(enum psCatalogue *catalogue, ///< Source catalogue 87 psObjectArray *objects ///< The objects 88 88 ); 89 89 90 90 /** Destructor */ 91 91 void 92 psCatalogueObjectsFree(psCatalogueObjects *restrict myCatalogueObjects // !< Object to destroy92 psCatalogueObjectsFree(psCatalogueObjects *restrict myCatalogueObjects ///< Object to destroy 93 93 ); 94 94 … … 97 97 /** A "super" object --- an object with multiple detections in different images */ 98 98 typedef struct { 99 const struct psImageArray *images; // !< Images that provided the different measurements100 const psObjectArray *objects; // !< Individual object measurements99 const struct psImageArray *images; ///< Images that provided the different measurements 100 const psObjectArray *objects; ///< Individual object measurements 101 101 102 102 /* Derived quantities */ 103 psSkyPos *meanSkyPos; // !< Mean position on the sky104 double pmRA, pmDec; // !< Proper motion in RA and Dec105 double pmRAErr, pmDecErr; // !< Errors in proper motion106 float posChi2; // !< chi^2 for position103 psSkyPos *meanSkyPos; ///< Mean position on the sky 104 double pmRA, pmDec; ///< Proper motion in RA and Dec 105 double pmRAErr, pmDecErr; ///< Errors in proper motion 106 float posChi2; ///< chi^2 for position 107 107 } psSuperObject; 108 108 109 109 /** Constructor */ 110 110 psSuperObject * 111 psSuperObjectAlloc(const struct psImageArray *images, // !< The images with the measurements112 const psObjectArray *objects // !< Object measurements111 psSuperObjectAlloc(const struct psImageArray *images, ///< The images with the measurements 112 const psObjectArray *objects ///< Object measurements 113 113 ); 114 114 115 115 /** Destructor */ 116 116 void 117 psSuperObjectFree(psSuperObject *restrict mySuperObject // !< Object to destroy117 psSuperObjectFree(psSuperObject *restrict mySuperObject ///< Object to destroy 118 118 ); 119 119 … … 129 129 */ 130 130 psIntArray * 131 psCorrelateObjects(const psObjectArray *restrict myObjects1, // !< First bunch of objects132 const psObjectArray *restrict myObjects2, // !< Second bunch of objects133 const psOTADescription *myOTA1, // !< OTA description for first bunch of objects, or NULL for134 // !< sky135 const psOTADescription *myOTA2 // !< OTA description for second bunch of objects, or NULL for136 // !< sky131 psCorrelateObjects(const psObjectArray *restrict myObjects1, ///< First bunch of objects 132 const psObjectArray *restrict myObjects2, ///< Second bunch of objects 133 const psOTADescription *myOTA1, ///< OTA description for first bunch of objects, or NULL for 134 ///< sky 135 const psOTADescription *myOTA2 ///< OTA description for second bunch of objects, or NULL for 136 ///< sky 137 137 ); 138 138 … … 142 142 */ 143 143 int 144 psGetCorrelatedMatches(const psIntArray matches, // !< Index array specifying matches */145 const psObjectArray *restrict myObjects1, // !< First bunch of objects146 const psObjectArray *restrict myObjects2, // !< Second bunch of objects147 psObjectArray *matched1, // !< Matched objects in first bunch148 psObjectArray *matched2 // !< Matched objects in second bunch144 psGetCorrelatedMatches(const psIntArray matches, ///< Index array specifying matches */ 145 const psObjectArray *restrict myObjects1, ///< First bunch of objects 146 const psObjectArray *restrict myObjects2, ///< Second bunch of objects 147 psObjectArray *matched1, ///< Matched objects in first bunch 148 psObjectArray *matched2 ///< Matched objects in second bunch 149 149 ); 150 150 … … 155 155 /** Get objects within a particular magnitude range */ 156 156 psObjectArray * 157 psSelectObjectMag(psObjectArray *restrict myArray, // !< Bunch of objects to select from158 float magLower, // !< Lower bound for magnitude159 float magUpper // !< Upper bound for magnitude157 psSelectObjectMag(psObjectArray *restrict myArray, ///< Bunch of objects to select from 158 float magLower, ///< Lower bound for magnitude 159 float magUpper ///< Upper bound for magnitude 160 160 ); 161 161 162 162 /** Get objects within a radius on the sky */ 163 163 psObjectArray * 164 psSelectObjectSkyDist(psObjectArray *restrict myArray, // !< Bunch of objects to select from165 psSkyPos *skyPos, // !< Position on the sky166 float radius, // !< Radius of search167 int circleOrSquare // !< Circle = 1, Square = 2164 psSelectObjectSkyDist(psObjectArray *restrict myArray, ///< Bunch of objects to select from 165 psSkyPos *skyPos, ///< Position on the sky 166 float radius, ///< Radius of search 167 int circleOrSquare ///< Circle = 1, Square = 2 168 168 ); 169 169 170 170 /** Get objects within a particular colour range */ 171 171 psObjectArray * 172 psSelectObjectColour(psObjectArray *restrict myArray, // !< Bunch of objects to select from173 float magLower, // !< Lower bound for colour174 float magUpper, // !< Upper bound for colour175 psColourRef colourRef // !< Only select those with this colour reference172 psSelectObjectColour(psObjectArray *restrict myArray, ///< Bunch of objects to select from 173 float magLower, ///< Lower bound for colour 174 float magUpper, ///< Upper bound for colour 175 psColourRef colourRef ///< Only select those with this colour reference 176 176 ); 177 177 -
trunk/archive/pslib/include/psPhotom.h
r283 r344 15 15 /** photometry system definition */ 16 16 typedef struct { 17 int ID; // !< ID number for this photometric system18 char *name; // !< Name of photometric system19 char *camera; // !< Camera for photometric system20 char *filter; // !< Filter used for photometric system21 char *detector; // !< Detector used for photometric system17 int ID; ///< ID number for this photometric system 18 char *name; ///< Name of photometric system 19 char *camera; ///< Camera for photometric system 20 char *filter; ///< Filter used for photometric system 21 char *detector; ///< Detector used for photometric system 22 22 } psPhotSystem; 23 23 24 24 /** photometry transformations */ 25 25 typedef struct { 26 psPhotSystem src; // !< Source photometric system27 psPhotSystem dst; // !< Destination photometric system26 psPhotSystem src; ///< Source photometric system 27 psPhotSystem dst; ///< Destination photometric system 28 28 psPhotSystem pP, pM; ///< Primary colour reference 29 29 psPhotSystem sP, sM; ///< Secondary colour reference 30 30 float pA, sA; ///< Colour offset for primary and secondary references 31 psPolynomial3D transform; // !< Transformation from source to destination31 psPolynomial3D transform; ///< Transformation from source to destination 32 32 } psPhotTransform; 33 33 -
trunk/archive/pslib/include/psPosition.h
r295 r344 13 13 typedef union { 14 14 struct { 15 double x; // !< x position16 double y; // !< y position17 double xErr; // !< Error in x position18 double yErr; // !< Error in y position15 double x; ///< x position 16 double y; ///< y position 17 double xErr; ///< Error in x position 18 double yErr; ///< Error in y position 19 19 } xy; 20 20 struct { 21 double r; // !< RA22 double d; // !< Dec23 double rErr; // !< Error in RA24 double dErr; // !< Error in Dec21 double r; ///< RA 22 double d; ///< Dec 23 double rErr; ///< Error in RA 24 double dErr; ///< Error in Dec 25 25 } rd; 26 26 } psCoord; … … 48 48 49 49 /** apply the coordinate transformation to the given coordinate */ 50 psCoord *psCoordXformApply (psCoord *out, // !< Output coordinates, or NULL50 psCoord *psCoordXformApply (psCoord *out, ///< Output coordinates, or NULL 51 51 const psCoordXform *frame, ///< coordinate transformation 52 52 const psCoord *coords ///< input coordiate … … 54 54 55 55 /** apply the optical distortion to the given coordinate, magnitude, color */ 56 psCoord *psDistortionApply (psCoord *out, // !< Output coordinates, or NULL56 psCoord *psDistortionApply (psCoord *out, ///< Output coordinates, or NULL 57 57 const psdistortion *pattern, ///< optical distortion pattern 58 58 const psCoord *coords, ///< input coordinate … … 63 63 /** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */ 64 64 psCoord * 65 psGetOffset(const psCoord *restrict position1, // !< Position 166 const psCoord *restrict position2, // !< Position 267 const char *type // !< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc65 psGetOffset(const psCoord *restrict position1, ///< Position 1 66 const psCoord *restrict position2, ///< Position 2 67 const char *type ///< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc 68 68 ); 69 69 70 70 /** Apply an offset to a position */ 71 71 psCoord * 72 psApplyOffset(const psCoord *restrict position, // !< Position73 const psCoord *restrict offset, // !< Offset74 const char *type // !< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc72 psApplyOffset(const psCoord *restrict position, ///< Position 73 const psCoord *restrict offset, ///< Offset 74 const char *type ///< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc 75 75 ); 76 76 … … 79 79 /** Get Sun Position */ 80 80 psCoord * 81 psGetSunPos(float mjd // !< MJD to get position for81 psGetSunPos(float mjd ///< MJD to get position for 82 82 ); 83 83 84 84 /** Get Moon position */ 85 85 psCoord * 86 psGetMoonPos(float mjd, // !< MJD to get position for87 double latitude, // !< Latitude for apparent position88 double longitude // !< Longitude for apparent position86 psGetMoonPos(float mjd, ///< MJD to get position for 87 double latitude, ///< Latitude for apparent position 88 double longitude ///< Longitude for apparent position 89 89 ); 90 90 91 91 /** Get Moon phase */ 92 92 float 93 psGetMoonPhase(float mjd // !< MJD to get phase for93 psGetMoonPhase(float mjd ///< MJD to get phase for 94 94 ); 95 95 96 96 /** Get Planet positions */ 97 97 psCoord * 98 psGetSolarSystemPos(const char *solarSystemObject, // !< Named S.S. object99 float mjd // !< MJD to get position for98 psGetSolarSystemPos(const char *solarSystemObject, ///< Named S.S. object 99 float mjd ///< MJD to get position for 100 100 ); 101 101 … … 106 106 /** Convert ICRS to Ecliptic */ 107 107 psCoord * 108 psCoordinatesItoE(const psCoord *restrict coordinates // !< ICRS coordinates to convert108 psCoordinatesItoE(const psCoord *restrict coordinates ///< ICRS coordinates to convert 109 109 ); 110 110 111 111 /** Convert Ecliptic to ICRS */ 112 112 psCoord * 113 psCoordinatesEtoI(const psCoord *restrict coordinates // !< Ecliptic coordinates to convert113 psCoordinatesEtoI(const psCoord *restrict coordinates ///< Ecliptic coordinates to convert 114 114 ); 115 115 116 116 /** Convert ICRS to Galactic */ 117 117 psCoord * 118 psCoordinatesItoG(const psCoord *restrict coordinates // !< ICRS coordinates to convert118 psCoordinatesItoG(const psCoord *restrict coordinates ///< ICRS coordinates to convert 119 119 ); 120 120 121 121 /** Convert Galactic to ICRS */ 122 122 psCoord * 123 psCoordinatesGtoI(const psCoord *restrict coordinates // !< Galactic coordinates to convert123 psCoordinatesGtoI(const psCoord *restrict coordinates ///< Galactic coordinates to convert 124 124 ); 125 125 -
trunk/archive/pslib/include/psSort.h
r257 r344 14 14 /** Sort an array. Inputs not restrict-ed to allow sort in place */ 15 15 psFloatArray * 16 psSort(psFloatArray *out, // !< Sorted array to return. May be NULL17 const psFloatArray *myArray // !< Array to sort16 psSort(psFloatArray *out, ///< Sorted array to return. May be NULL 17 const psFloatArray *myArray ///< Array to sort 18 18 ); 19 19 20 20 /** Sort an array, along with some other stuff. Returns an index array */ 21 21 psIntArray * 22 psSortIndex(psIntArray *restrict out, // !< Output index array (may be NULL)23 const psFloatArray *restrict myArray // !< Array to sort22 psSortIndex(psIntArray *restrict out, ///< Output index array (may be NULL) 23 const psFloatArray *restrict myArray ///< Array to sort 24 24 ); 25 25 -
trunk/archive/pslib/include/psStats.h
r257 r344 39 39 /** generic statistics structure */ 40 40 typedef struct { 41 double sampleMean; // <!formal mean of sample42 double sampleMedian; // <!formal median of sample43 double sampleMode; // !< Formal mode of sample44 double sampleStdev; // <!standard deviation of sample45 double sampleUQ; // <!upper quartile of sample46 double sampleLQ; // <!lower quartile of sample47 double robustMean; // <!robust mean of array48 double robustMeanError; // <!error on robust mean49 int robustMeanNvalues; // <!number of measurements used for robust mean50 double robustMedian; // <!robust median of array51 double robustMedianError; // <!error on robust median52 int robustMedianNvalues; // <!number of measurements used for robust median53 double robustMode; // !< Robust mode of array54 double robustModeErr; // !< Error in robust mode55 int robustModeNvalues; // !< Number of measurements used for robust mode56 double robustStdev; // <!robust standard deviation of array57 double robustUQ; // <!robust upper quartile58 double robustLQ; // <!robust lower quartile59 double clippedMean; // <!Nsigma clipped mean60 double clippedMeanError; // <!error on clipped mean61 int clippedMeanNvalues; // <!number of data points used for clipped mean62 double clippedStdev; // !< standard deviation after clipping63 double clipSigma; // <!Nsigma used for clipping; user input64 int clipIter; // !< Number of clipping iterations; user input65 double min; // <!minimum data value in array66 double max; // <!maximum data value in array67 int nValues; // <!number of data values in array68 psStatsOptions options; // <!bitmask of calculated values41 double sampleMean; ///< formal mean of sample 42 double sampleMedian; ///< formal median of sample 43 double sampleMode; ///< Formal mode of sample 44 double sampleStdev; ///< standard deviation of sample 45 double sampleUQ; ///< upper quartile of sample 46 double sampleLQ; ///< lower quartile of sample 47 double robustMean; ///< robust mean of array 48 double robustMeanError; ///< error on robust mean 49 int robustMeanNvalues; ///< number of measurements used for robust mean 50 double robustMedian; ///< robust median of array 51 double robustMedianError; ///< error on robust median 52 int robustMedianNvalues; ///< number of measurements used for robust median 53 double robustMode; ///< Robust mode of array 54 double robustModeErr; ///< Error in robust mode 55 int robustModeNvalues; ///< Number of measurements used for robust mode 56 double robustStdev; ///< robust standard deviation of array 57 double robustUQ; ///< robust upper quartile 58 double robustLQ; ///< robust lower quartile 59 double clippedMean; ///< Nsigma clipped mean 60 double clippedMeanError; ///< error on clipped mean 61 int clippedMeanNvalues; ///< number of data points used for clipped mean 62 double clippedStdev; ///< standard deviation after clipping 63 double clipSigma; ///< Nsigma used for clipping; user input 64 int clipIter; ///< Number of clipping iterations; user input 65 double min; ///< minimum data value in array 66 double max; ///< maximum data value in array 67 int nValues; ///< number of data values in array 68 psStatsOptions options; ///< bitmask of calculated values 69 69 } psStats; 70 70 … … 72 72 /** Do Statistics on an array. Returns a status value. \ingroup MathGroup */ 73 73 psStats * 74 psArrayStats(const psFloatArray *restrict myArray, // !< Array to be analysed75 const psIntArray *restrict maskArray, // !< Ignore elements where (maskArray & maskVal) != 076 // !< May be NULL77 unsigned int maskVal, // !< Only mask elements with one of these bits set in maskArray78 psStats *stats // !< stats structure defines stats to be calculated and how74 psArrayStats(const psFloatArray *restrict myArray, ///< Array to be analysed 75 const psIntArray *restrict maskArray, ///< Ignore elements where (maskArray & maskVal) != 0 76 ///< May be NULL 77 unsigned int maskVal, ///< Only mask elements with one of these bits set in maskArray 78 psStats *stats ///< stats structure defines stats to be calculated and how 79 79 ); 80 80 … … 83 83 /** Histograms */ 84 84 typedef struct { 85 const psFloatArray *restrict lower; // !< Lower bounds for the bins86 const psFloatArray *restrict upper; // !< Upper bounds for the bins87 psIntArray *nums; // !< Number in each of the bins88 const float minVal, maxVal; // !< Minimum and maximum values89 int minNum, maxNum; // !< Number below the minimum and above the maximum85 const psFloatArray *restrict lower; ///< Lower bounds for the bins 86 const psFloatArray *restrict upper; ///< Upper bounds for the bins 87 psIntArray *nums; ///< Number in each of the bins 88 const float minVal, maxVal; ///< Minimum and maximum values 89 int minNum, maxNum; ///< Number below the minimum and above the maximum 90 90 } psHistogram; 91 91 92 92 /** Constructor \ingroup MathGroup */ 93 93 psHistogram * 94 psHistogramAlloc(float lower, // !< Lower limit for the bins95 float upper, // !< Upper limit for the bins96 float size // !< Size of the bins94 psHistogramAlloc(float lower, ///< Lower limit for the bins 95 float upper, ///< Upper limit for the bins 96 float size ///< Size of the bins 97 97 ); 98 98 99 99 /** Generic constructor \ingroup MathGroup */ 100 100 psHistogram * 101 psHistogramAllocGeneric(const psFloatArray *restrict lower, // !< Lower bounds for the bins102 const psFloatArray *restrict upper, // !< Upper bounds for the bins103 float minVal, // !< Minimum value104 float maxVal // !< Maximum value101 psHistogramAllocGeneric(const psFloatArray *restrict lower, ///< Lower bounds for the bins 102 const psFloatArray *restrict upper, ///< Upper bounds for the bins 103 float minVal, ///< Minimum value 104 float maxVal ///< Maximum value 105 105 ); 106 106 107 107 /** Destructor \ingroup MathGroup **/ 108 108 void 109 psHistogramFree(psHistogram *restrict myHist // !< Histogram to destroy109 psHistogramFree(psHistogram *restrict myHist ///< Histogram to destroy 110 110 ); 111 111 … … 113 113 /** Calculate a histogram \ingroup MathGroup **/ 114 114 psHistogram * 115 psGetArrayHistogram(psHistogram *restrict myHist, // !< Histogram data116 const psFloatArray *restrict myArray // !< Array to analyse115 psGetArrayHistogram(psHistogram *restrict myHist, ///< Histogram data 116 const psFloatArray *restrict myArray ///< Array to analyse 117 117 ); 118 118 -
trunk/archive/pslib/include/psStdArrays.h
r339 r344 100 100 101 101 /** Transpose a vector. Changes the type to a PS_DIMEN_TRANSV */ 102 psVector *psVectorTranspose(psVector *out, // !< Output vector, or NULL103 psVector *myVector // !< Vector to be transposed102 psVector *psVectorTranspose(psVector *out, ///< Output vector, or NULL 103 psVector *myVector ///< Vector to be transposed 104 104 ); 105 105 … … 200 200 */ 201 201 typedef struct { 202 int n; // !< Number of elements in use203 int size; // !< Number of total elements204 void **arr; // !< The elements202 int n; ///< Number of elements in use 203 int size; ///< Number of total elements 204 void **arr; ///< The elements 205 205 } psVoidPtrArray; 206 206 207 207 /** Constructor \ingroup DataGroup */ 208 psVoidPtrArray *psVoidPtrArrayAlloc(int n, // !< Number of elements to use209 int s // !< Total number of elements208 psVoidPtrArray *psVoidPtrArrayAlloc(int n, ///< Number of elements to use 209 int s ///< Total number of elements 210 210 ); 211 211 /** Reallocate \ingroup DataGroup */ 212 psVoidPtrArray *psVoidPtrArrayRealloc(psVoidPtrArray *arr, // !< Array to reallocate213 int n // !< Number of elements212 psVoidPtrArray *psVoidPtrArrayRealloc(psVoidPtrArray *arr, ///< Array to reallocate 213 int n ///< Number of elements 214 214 ); 215 215 /** Destructor \ingroup DataGroup */ 216 void psVoidPtrArrayFree(psVoidPtrArray *arr, // !< array to destroy217 void (*elemFree)(void *) // !< destructor for array data216 void psVoidPtrArrayFree(psVoidPtrArray *arr, ///< array to destroy 217 void (*elemFree)(void *) ///< destructor for array data 218 218 ); 219 219
Note:
See TracChangeset
for help on using the changeset viewer.
