Changeset 153
- Timestamp:
- Mar 9, 2004, 12:28:16 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 15 edited
-
psAstrom.h (modified) (5 diffs)
-
psBitMask.h (modified) (1 diff)
-
psColour.h (modified) (1 diff)
-
psComplexArrays.h (modified) (1 diff)
-
psDateTime.h (modified) (1 diff)
-
psFFT.h (modified) (1 diff)
-
psFilter.h (modified) (1 diff)
-
psFunctions.h (modified) (1 diff)
-
psMatrix.h (modified) (2 diffs)
-
psMinimise.h (modified) (1 diff)
-
psObjects.h (modified) (5 diffs)
-
psPosition.h (modified) (7 diffs)
-
psSort.h (modified) (1 diff)
-
psStats.h (modified) (1 diff)
-
psStdArrays.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psAstrom.h
r149 r153 14 14 /***********************************************************************************************************/ 15 15 16 /* Astrometric coefficients */17 typedef struct { 18 int xyOrder; // Spatial (x,y) order of polynomial19 int colourOrder; // Order of polynomial in colour20 int magOrder; // Order of polynomial in magnitude21 int xyColourOrder; // Spatial (x,y) order of polynomial in colour times x and y22 int xyMagOrder; // Spatial (x,y) order of polynomial in magnitude times x and y23 enum psColourRef colourRef; // Colour reference24 psDoubleArray *restrict coeff; // Coefficients of astrometric solution25 psDoubleArray *restrict coeffErr; // Error in coefficients16 /** Astrometric coefficients */ 17 typedef struct { 18 int xyOrder; //!< Spatial (x,y) order of polynomial 19 int colourOrder; //!< Order of polynomial in colour 20 int magOrder; //!< Order of polynomial in magnitude 21 int xyColourOrder; //!< Spatial (x,y) order of polynomial in colour times x and y 22 int xyMagOrder; //!< Spatial (x,y) order of polynomial in magnitude times x and y 23 enum psColourRef colourRef; //!< Colour reference 24 psDoubleArray *restrict coeff; //!< Coefficients of astrometric solution 25 psDoubleArray *restrict coeffErr; //!< Error in coefficients 26 26 } psAstromCoeffs; 27 27 28 /* Constructor */28 /** Constructor */ 29 29 psAstromCoeffs * 30 psAstromCoeffsNew(int xyOrder, // Spatial (x,y) order of polynomial31 int colourOrder, // Order of polynomial in colour32 int magOrder, // Order of polynomial in magnitude33 int xyColourOrder, // Spatial (x,y) order of polynomial in colour times x and y34 int xyMagOrder, // Spatial (x,y) order of polynomial in magnitude times x and y35 enum psColourRef colourRef // Colour reference36 ); 37 38 /* Destructor */39 void 40 psAstromCoeffsDel(psAstromCoeffs *restrict myAstromCoeffs // Object to destroy41 ); 42 43 /***********************************************************************************************************/ 44 45 /* Telescope pointing information for an exposure */30 psAstromCoeffsNew(int xyOrder, //!< Spatial (x,y) order of polynomial 31 int colourOrder, //!< Order of polynomial in colour 32 int magOrder, //!< Order of polynomial in magnitude 33 int xyColourOrder, //!< Spatial (x,y) order of polynomial in colour times x and y 34 int xyMagOrder, //!< Spatial (x,y) order of polynomial in magnitude times x and y 35 enum psColourRef colourRef //!< Colour reference 36 ); 37 38 /** Destructor */ 39 void 40 psAstromCoeffsDel(psAstromCoeffs *restrict myAstromCoeffs //!< Object to destroy 41 ); 42 43 /***********************************************************************************************************/ 44 45 /** Telescope pointing information for an exposure */ 46 46 typedef struct { 47 47 // Telescope longitude, latitude and height are stored separately, since they don't change with pointing 48 double ra, dec; // Telescope boresight49 double ha; // Hour angle50 double zd; // Zenith distance51 double az; // Azimuth52 float rotAngle; // Rotator position angle53 float temp; // Temperature54 float pressure; // Pressure48 double ra, dec; //!< Telescope boresight 49 double ha; //!< Hour angle 50 double zd; //!< Zenith distance 51 double az; //!< Azimuth 52 float rotAngle; //!< Rotator position angle 53 float temp; //!< Temperature 54 float pressure; //!< Pressure 55 55 /* Derived quantities */ 56 float parallactic; // Parallactic angle57 float airmass; // Airmass, calculated from zenith distance56 float parallactic; //!< Parallactic angle 57 float airmass; //!< Airmass, calculated from zenith distance 58 58 } psTelPointing; 59 59 60 /* Constructor */60 /** Constructor */ 61 61 psTelPointing * 62 psTelPointingNew(double ra, double dec, // Telescope boresight63 double ha, // Hour angle64 double zd, // Zenith distance65 double az, // Azimuth66 float rotAngle, // Rotator position angle67 float temp, // Temperature68 float pressure // Pressure69 ); 70 71 /* Destructor */72 void 73 psTelPointingDel(psTelPointing *restrict myTelPointing // Object to destroy74 ); 75 76 77 /***********************************************************************************************************/ 78 79 /* Cell details: specifies how the cell is mounted on its parent OTA*/80 typedef struct { 81 psOTAPos position; // Position of cell in its OTA. Specifies the position of the82 // (imaginary) pixel (0,0)83 float rotation; // Rotation of cell in its OTA. Specified from +x through +y84 int xSize, ySize; // Number of pixels in x and y85 float scale; // Relative pixel scales, if CCD pitch varies. Specify a positive86 // scale for a left-handed coordinate system, negative for right. If87 // NULL, then every chip has identical scale, and system is88 // left-handed.62 psTelPointingNew(double ra, double dec, //!< Telescope boresight 63 double ha, //!< Hour angle 64 double zd, //!< Zenith distance 65 double az, //!< Azimuth 66 float rotAngle, //!< Rotator position angle 67 float temp, //!< Temperature 68 float pressure //!< Pressure 69 ); 70 71 /** Destructor */ 72 void 73 psTelPointingDel(psTelPointing *restrict myTelPointing //!< Object to destroy 74 ); 75 76 77 /***********************************************************************************************************/ 78 79 /** Cell details: specifies how the cell is mounted on its parent OTA */ 80 typedef struct { 81 psOTAPos position; //!< Position of cell in its OTA. Specifies the position of the 82 //!< (imaginary) pixel (0,0) 83 float rotation; //!< Rotation of cell in its OTA. Specified from +x through +y 84 int xSize, ySize; //!< Number of pixels in x and y 85 float scale; //!< Relative pixel scales, if CCD pitch varies. Specify a positive 86 //!< scale for a left-handed coordinate system, negative for right. If 87 //!< NULL, then every chip has identical scale, and system is 88 //!< left-handed. 89 89 } psCellDescription; 90 90 91 /* Constructor */91 /** Constructor */ 92 92 psCellDescription * 93 93 psCellDescriptionNew(void); 94 94 95 /* Destructor */96 void 97 psCellDescriptionDel(psCellDescription *restrict myCell // Cell description to destroy98 ); 99 100 /***********************************************************************************************************/ 101 102 /* Array of cell descriptions */95 /** Destructor */ 96 void 97 psCellDescriptionDel(psCellDescription *restrict myCell //!< Cell description to destroy 98 ); 99 100 /***********************************************************************************************************/ 101 102 /** Array of cell descriptions */ 103 103 PS_DECLARE_ARRAY_TYPE(psCellDescription); 104 104 PS_CREATE_ARRAY_TYPE(psCellDescription); … … 106 106 /***********************************************************************************************************/ 107 107 108 /* OTA details: specifies how the OTA is mounted on the focal plane */109 typedef struct { 110 psOTAPos position; // Position of OTA on the focal plane. Specifies the position of the111 // bottom left-hand corner.112 float rotation; // Rotation of OTA on the focal plane. Specified from +x through +y113 psCellDescriptionArray *restrict cells; // Cell descriptions114 psOTAAstrom *astrom; // OTA astrometry108 /** OTA details: specifies how the OTA is mounted on the focal plane */ 109 typedef struct { 110 psOTAPos position; //!< Position of OTA on the focal plane. Specifies the position of the 111 //!< bottom left-hand corner. 112 float rotation; //!< Rotation of OTA on the focal plane. Specified from +x through +y 113 psCellDescriptionArray *restrict cells; //!< Cell descriptions 114 psOTAAstrom *astrom; //!< OTA astrometry 115 115 } psOTADescription; 116 116 117 /* Constructor */117 /** Constructor */ 118 118 psOTADescription * 119 119 psOTADescriptionNew(void); 120 120 121 /* Destructor*/122 void 123 psOTADescriptionDel(psOTADescription *restrict myOTA // OTA description to destroy124 ); 125 126 /***********************************************************************************************************/ 127 128 /* Astrometric solution for an OTA */129 /* There are four coordinate frames that we need to worry about:121 /** Destructor. */ 122 void 123 psOTADescriptionDel(psOTADescription *restrict myOTA //!< OTA description to destroy 124 ); 125 126 /***********************************************************************************************************/ 127 128 /** Astrometric solution for an OTA. 129 * There are four coordinate frames that we need to worry about: 130 130 * 1. Chip frame: chip# plus x,y in pixels 131 131 * 2. Focal plane frame: X,Y in microns … … 144 144 typedef struct { 145 145 /* Focal plane to and from tangent plane */ 146 psAstromCoeffs *restrict tpToFP; // General astrometric solution for tangent plane to focal plane147 psAstromCoeffs *restrict fpToTP; // General astrometric solution for focal plane to tangent plane148 psMatrix *pattern; // Fixed pattern distortions for focal plane to tangent plane (simply149 // * -1 for the reverse); MAY NEED TO BE REVISED UPON IMPLEMENTATION146 psAstromCoeffs *restrict tpToFP; //!< General astrometric solution for tangent plane to focal plane 147 psAstromCoeffs *restrict fpToTP; //!< General astrometric solution for focal plane to tangent plane 148 psMatrix *pattern; //!< Fixed pattern distortions for focal plane to tangent plane (simply 149 //!< * -1 for the reverse); MAY NEED TO BE REVISED UPON IMPLEMENTATION 150 150 /* Tangent plane to and from the celestial sphere */ 151 psDoubleArray *restrict tp; // Data needed to convert from the sky to the tangent plane and back;152 // produced by and used by SLALib (a.k.a. "Wallace's Grommit")151 psDoubleArray *restrict tp; //!< Data needed to convert from the sky to the tangent plane and back; 152 //!< produced by and used by SLALib (a.k.a. "Wallace's Grommit") 153 153 /* Characterisation of the solution */ 154 float rmsX, rmsY; // Dispersion in astrometric solution155 float chi2; // chi^2 of astrometric solution154 float rmsX, rmsY; //!< Dispersion in astrometric solution 155 float chi2; //!< chi^2 of astrometric solution 156 156 } psOTAAstrom; 157 157 158 /* Constructor */158 /** Constructor */ 159 159 psAstrom * 160 psAstromNew(const psTelPointing *telescope //Telescope pointing, used to initialise the tp data.161 ); 162 163 /* Destructor */164 void 165 psAstromDel(psAstrom *restrict myAstrom // Object to destroy160 psAstromNew(const psTelPointing *telescope //!< Telescope pointing, used to initialise the tp data. 161 ); 162 163 /** Destructor */ 164 void 165 psAstromDel(psAstrom *restrict myAstrom //!< Object to destroy 166 166 ); 167 167 … … 170 170 /* Calculating and applying astrometric solutions */ 171 171 172 /* Convert (RA,Dec) to (cell#,x,y) */172 /** Convert (RA,Dec) to (cell#,x,y) */ 173 173 psOTAPos * 174 psSkyToOTA(const psSkyPos *restrict position, // Position on the sky175 const psOTADescription *restrict ota // OTA details176 ); 177 178 /* Convert (cell#,x,y) to (RA,Dec) */174 psSkyToOTA(const psSkyPos *restrict position, //!< Position on the sky 175 const psOTADescription *restrict ota //!< OTA details 176 ); 177 178 /** Convert (cell#,x,y) to (RA,Dec) */ 179 179 psSkyPos * 180 psOTAToSky(const psOTAPos *restrict position, // Position on the detector181 const psOTADescription *restrict ota // OTA details182 ); 183 184 /* Fit astrometric solution to list of (chip#,x,y) and (RA,Dec) */180 psOTAToSky(const psOTAPos *restrict position, //!< Position on the detector 181 const psOTADescription *restrict ota //!< OTA details 182 ); 183 184 /** Fit astrometric solution to list of (chip#,x,y) and (RA,Dec) */ 185 185 int 186 psFitAstrom(psOTADescription *restrict ota, // psAstrom struct containing initial guess for coefficients187 const psOTAPosArray *restrict detector, // Positions on OTA (chip#,x,y)188 const psSkyPosArray *restrict sky, // Positions on the sky (RA,Dec)189 const psTelPointing *telescope // Telescope pointing information, for airmass, parallactic angle190 // which may help set the astrometric solution186 psFitAstrom(psOTADescription *restrict ota, //!< psAstrom struct containing initial guess for coefficients 187 const psOTAPosArray *restrict detector, //!< Positions on OTA (chip#,x,y) 188 const psSkyPosArray *restrict sky, //!< Positions on the sky (RA,Dec) 189 const psTelPointing *telescope //!< Telescope pointing information, for airmass, parallactic angle 190 //!< which may help set the astrometric solution 191 191 ); 192 192 … … 195 195 /* Functions needed for astrometry, and will likely be useful elsewhere */ 196 196 197 /* Get the airmass for a given position and sidereal time */197 /** Get the airmass for a given position and sidereal time */ 198 198 float 199 psGetAirmass(const psSkyPos *restrict position, // Position on the sky200 float siderealTime // Sidereal time199 psGetAirmass(const psSkyPos *restrict position, //!< Position on the sky 200 float siderealTime //!< Sidereal time 201 201 ); 202 202 203 /* Get the parallactic angle for a given position and sidereal time */203 /** Get the parallactic angle for a given position and sidereal time */ 204 204 float 205 psGetParallactic(const psSkyPos *restrict position, // Position on the sky206 real siderealTime // Sidereal time205 psGetParallactic(const psSkyPos *restrict position, //!< Position on the sky 206 real siderealTime //!< Sidereal time 207 207 ); 208 208 209 /* Estimate atmospheric refraction, along the parallactic */209 /** Estimate atmospheric refraction, along the parallactic */ 210 210 float 211 psGetRefraction(float colour, // Colour of object212 enum psColourRef colourRef; // Colour reference213 psTelPointing telescope // Telescope pointing information, for airmass, temp and pressure211 psGetRefraction(float colour, //!< Colour of object 212 enum psColourRef colourRef; //!< Colour reference 213 psTelPointing telescope //!< Telescope pointing information, for airmass, temp and pressure 214 214 ); 215 215 -
trunk/archive/pslib/include/psBitMask.h
r149 r153 2 2 #define PS_BIT_MASK_H 3 3 4 /* Type for a big bitmask */ 5 /* Set to long int for now */ 4 /** Type for a big bitmask. Set to long int for now. */ 6 5 typedef long int psBitMask; 7 6 8 7 9 /* Set a bit mask */8 /** Set a bit mask */ 10 9 psBitMask * 11 psSetBitMask(psBitMask *outMask, // Output bit mask or NULL12 const psBitMask *myMask, // Input bit mask13 int bit // Bit to set10 psSetBitMask(psBitMask *outMask, //!< Output bit mask or NULL 11 const psBitMask *myMask, //!< Input bit mask 12 int bit //!< Bit to set 14 13 ); 15 14 16 /* Check a bit mask. Returns true or false */15 /** Check a bit mask. Returns true or false */ 17 16 int 18 psCheckBitMask(const psBitMask *checkMask, // Bit mask to check19 int bit // Bit to check17 psCheckBitMask(const psBitMask *checkMask, //!< Bit mask to check 18 int bit //!< Bit to check 20 19 ); 21 20 22 /* OR two bit masks */21 /** OR two bit masks */ 23 22 psBitMask * 24 psOrBitMasks(psBitMask *outMask, // Output bit mask or NULL25 const psBitMask *restrict inMask1, // Input bit mask 126 const psBitMask *restrict inMask2 // Input bit mask 223 psOrBitMasks(psBitMask *outMask, //!< Output bit mask or NULL 24 const psBitMask *restrict inMask1, //!< Input bit mask 1 25 const psBitMask *restrict inMask2 //!< Input bit mask 2 27 26 ); 28 27 29 /* AND two bit masks */28 /** AND two bit masks */ 30 29 psBitMask * 31 psAndBitMasks(psBitMask *outMask, // Output bit mask or NULL32 const psBitMask *restrict inMask1, // Input bit mask 133 const psBitMask *restrict inMask2 // Input bit mask 230 psAndBitMasks(psBitMask *outMask, //!< Output bit mask or NULL 31 const psBitMask *restrict inMask1, //!< Input bit mask 1 32 const psBitMask *restrict inMask2 //!< Input bit mask 2 34 33 ); 35 34 -
trunk/archive/pslib/include/psColour.h
r149 r153 2 2 #define PS_COLOUR_H 3 3 4 /* Colour References */5 4 6 /* 7 * Reference colours are roughly appropriate for a G5V star. I get, with an arbitrary zero point, on the AB 8 * system the following rough magnitudes: g = 1.36 mag, r = 0.84 mag, i = 0.72 mag, z = 0.69 mag, y = 0.69 9 * mag, w = 0.80 mag 5 /** Colour References. Reference colours are roughly appropriate for a G5V star. I get, with an arbitrary 6 * zero point, on the AB system the following rough magnitudes: g = 1.36 mag, r = 0.84 mag, i = 0.72 mag, z = 7 * 0.69 mag, y = 0.69 mag, w = 0.80 mag 10 8 */ 11 9 enum { 12 PS_COLOUR_NO_INFO, // No colour information13 PS_COLOUR_G_MINUS_R, // Reference is g-r = 0.5 mag14 PS_COLOUR_R_MINUS_I, // Reference is r-i = 0.1 mag15 PS_COLOUR_I_MINUS_Z, // Reference is i-z = 0.0 mag16 PS_COLOUR_Z_MINUS_Y, // Reference is z-y = 0.0 mag17 PS_COLOUR_R_MINUS_W // Reference is r-w = 0.0 mag10 PS_COLOUR_NO_INFO, //!< No colour information 11 PS_COLOUR_G_MINUS_R, //!< Reference is g-r = 0.5 mag 12 PS_COLOUR_R_MINUS_I, //!< Reference is r-i = 0.1 mag 13 PS_COLOUR_I_MINUS_Z, //!< Reference is i-z = 0.0 mag 14 PS_COLOUR_Z_MINUS_Y, //!< Reference is z-y = 0.0 mag 15 PS_COLOUR_R_MINUS_W //!< Reference is r-w = 0.0 mag 18 16 } psColourRef; 19 17 -
trunk/archive/pslib/include/psComplexArrays.h
r149 r153 6 6 /* Complex number arrays */ 7 7 8 /* Multiplication of two complex number arrays */ 9 /* Purposely leave these NOT restrict-ed, so that the multiplication may be done in-place */ 8 /** Multiplication of two complex number arrays. Purposely leave these NOT restrict-ed, so that the 9 * multiplication may be done in-place 10 */ 10 11 psComplexArray * 11 psComplexMultiply(psComplexArray *out, // Output array to be returned; may be NULL12 const psComplexArray *complex1, // Input complex array 113 const psComplexArray *complex2 // Input complex array 212 psComplexMultiply(psComplexArray *out, //!< Output array to be returned; may be NULL 13 const psComplexArray *complex1, //!< Input complex array 1 14 const psComplexArray *complex2 //!< Input complex array 2 14 15 ); 15 16 16 /* Division of two complex number arrays */ 17 /* Purposely leave these NOT restrict-ed, so that the division may be done in-place */ 17 /** Division of two complex number arrays. Purposely leave these NOT restrict-ed, so that the division 18 * may be done in-place 19 */ 18 20 psComplexArray * 19 psComplexDivide(psComplexArray *out, // Output array to be returned; may be NULL20 const psComplexArray *complex1, // Input complex array 121 const psComplexArray *complex2 // Input complex array 221 psComplexDivide(psComplexArray *out, //!< Output array to be returned; may be NULL 22 const psComplexArray *complex1, //!< Input complex array 1 23 const psComplexArray *complex2 //!< Input complex array 2 22 24 ); 23 25 24 /* Complex conjugates for a complex number array */ 25 /* Purposely leave these NOT restrict-ed, so that the operation may be done in-place */ 26 /** Complex conjugates for a complex number array. Purposely leave these NOT restrict-ed, so that the 27 * operation may be done in-place 28 */ 26 29 psComplexArray * 27 psComplexConjugate(psComplexArray *out, // Output array to be returned; may be NULL28 const psComplexArray *myComplexNumbers // Input complex number array30 psComplexConjugate(psComplexArray *out, //!< Output array to be returned; may be NULL 31 const psComplexArray *myComplexNumbers //!< Input complex number array 29 32 ); 30 33 31 /* Moduli for a complex number array */34 /** Moduli for a complex number array */ 32 35 psFloatArray * 33 psComplexModulus(const psComplex *restrict myComplexNumbers // Input complex number array36 psComplexModulus(const psComplex *restrict myComplexNumbers //!< Input complex number array 34 37 ); 35 38 -
trunk/archive/pslib/include/psDateTime.h
r149 r153 4 4 /* Dates and Times */ 5 5 6 /* Get current MJD, for a timestamp */6 /** Get current MJD, for a timestamp */ 7 7 float 8 8 psGetMJD(void); 9 9 10 /* Convert MJD to Human-readable date/time string */10 /** Convert MJD to Human-readable date/time string */ 11 11 char * 12 psMJDToTime(float mjd // Input MJD12 psMJDToTime(float mjd //!< Input MJD 13 13 ); 14 14 15 /* Get Sidereal time */15 /** Get Sidereal time */ 16 16 float 17 psGetSidereal(float mjd, // MJD18 float longitude // Longitude17 psGetSidereal(float mjd, //!< MJD 18 float longitude //!< Longitude 19 19 ); 20 20 -
trunk/archive/pslib/include/psFFT.h
r149 r153 6 6 /* Fourier Transform functions */ 7 7 8 /* Return Fourier Transform of an array */8 /** Return Fourier Transform of an array */ 9 9 psComplexArray * 10 psRealFFT(psComplexArray *restrict out, // Output array to be returned; may be NULL11 const psFloatArray *restrict myArray // Input array10 psRealFFT(psComplexArray *restrict out, //!< Output array to be returned; may be NULL 11 const psFloatArray *restrict myArray //!< Input array 12 12 ); 13 13 14 /* Return [inverse?] Fourier Transform of a complex array */ 15 /* May NOT be done in-place (restrict-ed) */ 14 /** Return [inverse?] Fourier Transform of a complex array. May NOT be done in-place (restrict-ed) */ 16 15 psComplexArray * 17 psComplexFFT(psComplexArray *restrict out, // Output array to be returned; may be NULL18 const psComplexArray *restrict myArray, // Input array19 int sign // +1 or -1 to indicate direction of FT16 psComplexFFT(psComplexArray *restrict out, //!< Output array to be returned; may be NULL 17 const psComplexArray *restrict myArray, //!< Input array 18 int sign //!< +1 or -1 to indicate direction of FT 20 19 ); 21 20 22 /* Return Power spectrum of a array */21 /** Return Power spectrum of a array */ 23 22 psFloatArray * 24 psPowerSpec(psFloatArray *restrict out, // Output array to be returned25 const psFloatArray *restrict myArray // Input array23 psPowerSpec(psFloatArray *restrict out, //!< Output array to be returned 24 const psFloatArray *restrict myArray //!< Input array 26 25 ); 27 26 -
trunk/archive/pslib/include/psFilter.h
r149 r153 2 2 #define PS_FILTER_H 3 3 4 /** Filters */ 4 5 enum { 5 PS_FILTER_G, // g band6 PS_FILTER_R, // r band7 PS_FILTER_I, // i band8 PS_FILTER_Z, // z band9 PS_FILTER_Y, // y band10 PS_FILTER_W // w band6 PS_FILTER_G, //!< g band 7 PS_FILTER_R, //!< r band 8 PS_FILTER_I, //!< i band 9 PS_FILTER_Z, //!< z band 10 PS_FILTER_Y, //!< y band 11 PS_FILTER_W //!< w band 11 12 } psFilter; 12 13 -
trunk/archive/pslib/include/psFunctions.h
r149 r153 6 6 /* Standard Functions */ 7 7 8 /* Gaussian */ 9 /* Note that this is not a Gaussian deviate */ 8 /** Gaussian. Note that this is not a Gaussian deviate */ 10 9 float 11 psGaussian(float x, // Value at which to evaluate12 float mean, // Mean for the Gaussian13 float stddev // Standard deviation for the Gaussian10 psGaussian(float x, //!< Value at which to evaluate 11 float mean, //!< Mean for the Gaussian 12 float stddev //!< Standard deviation for the Gaussian 14 13 ); 15 14 16 /* Polynomial: one dimension */15 /** Polynomial: one dimension */ 17 16 float 18 psPolynomial1d(float x, // Value at which to evaluate19 const psFloatArray *restrict coeffs // Coefficients for the polynomial17 psPolynomial1d(float x, //!< Value at which to evaluate 18 const psFloatArray *restrict coeffs //!< Coefficients for the polynomial 20 19 ); 21 20 22 /* Polynomial: two dimensions */21 /** Polynomial: two dimensions */ 23 22 float 24 psPolynomial2d(float x, // Value x at which to evaluate25 float y, // Value y at which to evaluate26 int orderx, // Polynomial order in x27 int ordery, // Polynomial order in y28 const psFloatArray *coeffs // Coefficients for the polynomial23 psPolynomial2d(float x, //!< Value x at which to evaluate 24 float y, //!< Value y at which to evaluate 25 int orderx, //!< Polynomial order in x 26 int ordery, //!< Polynomial order in y 27 const psFloatArray *coeffs //!< Coefficients for the polynomial 29 28 ); 30 29 -
trunk/archive/pslib/include/psMatrix.h
r149 r153 2 2 #define PS_MATRIX_H 3 3 4 /* A matrix */4 /** A matrix */ 5 5 typedef struct { 6 int xSize, ySize; // Dimensions in x and y7 float *restrict *restrict value; // Values in matrix6 int xSize, ySize; //!< Dimensions in x and y 7 float *restrict *restrict value; //!< Values in matrix 8 8 } psMatrix; 9 9 10 /* Constructor */10 /** Constructor */ 11 11 psMatrix * 12 psMatrixNew(int Xdimen, // x dimension of new matrix13 int Ydimen // y dimension of new matrix12 psMatrixNew(int Xdimen, //!< x dimension of new matrix 13 int Ydimen //!< y dimension of new matrix 14 14 ); 15 15 16 /* Destructor */16 /** Destructor */ 17 17 void 18 psMatrixDel(psMatrix *restrict myMatrix // Matrix to destroy18 psMatrixDel(psMatrix *restrict myMatrix //!< Matrix to destroy 19 19 ); 20 20 … … 23 23 /* Linear Algebra */ 24 24 25 /* Invert matrix */ 26 /* Not using restrict, to allow inversion to be done in-place */ 25 /** Invert matrix. Not using restrict, to allow inversion to be done in-place */ 27 26 psMatrix * 28 psInvertMatrix(psMatrix *out, // Matrix to return, or NULL29 const psMatrix *myMatrix, // Matrix to be inverted30 float *restrict determinant // Determinant to return, or NULL27 psInvertMatrix(psMatrix *out, //!< Matrix to return, or NULL 28 const psMatrix *myMatrix, //!< Matrix to be inverted 29 float *restrict determinant //!< Determinant to return, or NULL 31 30 ); 32 31 33 /* Matrix determinant */32 /** Matrix determinant */ 34 33 float 35 psDeterminant(const psMatrix *restrict myMatrix // Matrix to get determinant for34 psDeterminant(const psMatrix *restrict myMatrix //!< Matrix to get determinant for 36 35 ); 37 36 38 /* Matrix Multiplication */ 39 /* Not using restrict, to allow matrix1 == matrix2, and to do multiplication in-place */ 37 /** Matrix Multiplication. Not using restrict, to allow matrix1 == matrix2, and to do multiplication 38 * in-place 39 */ 40 40 psMatrix 41 psMatrixMultiply(psMatrix *out, // Matrix to return, or NULL42 const psMatrix *matrix1, // Matrix 143 const psMatrix *matrix2 // Matrix 241 psMatrixMultiply(psMatrix *out, //!< Matrix to return, or NULL 42 const psMatrix *matrix1, //!< Matrix 1 43 const psMatrix *matrix2 //!< Matrix 2 44 44 ); 45 45 -
trunk/archive/pslib/include/psMinimise.h
r149 r153 7 7 /* Minimisation */ 8 8 9 /* Minimise a particular function */9 /** Minimise a particular function */ 10 10 psFloatArray * 11 psMinimise(float (*myFunction)(const psFloatArray *restrict), // Function to minimise12 psFloatArray *restrict initialGuess // Initial guess11 psMinimise(float (*myFunction)(const psFloatArray *restrict), //!< Function to minimise 12 psFloatArray *restrict initialGuess //!< Initial guess 13 13 ); 14 14 15 15 16 /* Minimise chi^2 for input data */16 /** Minimise chi^2 for input data */ 17 17 psFloatArray * 18 18 psMinimiseChi2(float (*evalModel)(const psFloatArray *restrict, 19 const psFloatArray *restrict), // Model to fit; receives domain and20 //parameters21 const psFloatArray *restrict domain, // The domain values for the corresponding measurements22 const psFloatArray *restrict data, // Data to fit23 const psFloatArray *restrict errors, // Errors in the data24 psFloatArray *restrict initialGuess, // Initial guess25 const psIntArray *restrict guessMask // 1 = fit for parameter, 0 = hold parameter constant19 const psFloatArray *restrict), //!< Model to fit; receives domain and 20 //!< parameters 21 const psFloatArray *restrict domain, //!< The domain values for the corresponding measurements 22 const psFloatArray *restrict data, //!< Data to fit 23 const psFloatArray *restrict errors, //!< Errors in the data 24 psFloatArray *restrict initialGuess, //!< Initial guess 25 const psIntArray *restrict guessMask //!< 1 = fit for parameter, 0 = hold parameter constant 26 26 ); 27 27 28 /* Derive a polynomial that goes through the points --- can be done analytically */28 /** Derive a polynomial that goes through the points --- can be done analytically */ 29 29 psFloatArray * 30 psGetArrayPolynomial(const psFloatArray *restrict ord, // Ordinates (or NULL to just use the indices)31 const psFloatArray *restrict coord // Coordinates30 psGetArrayPolynomial(const psFloatArray *restrict ord, //!< Ordinates (or NULL to just use the indices) 31 const psFloatArray *restrict coord //!< Coordinates 32 32 ); 33 33 -
trunk/archive/pslib/include/psObjects.h
r149 r153 20 20 /***********************************************************************************************************/ 21 21 22 /* Object definition, to handle both objects we detect, and catalogues */22 /** Object definition, to handle both objects we detect, and catalogues */ 23 23 typedef struct { 24 psOTAPos *otaPos; // Centre position on OTA, with associated error25 psSkyPos *skyPos; // Position on the sky, with associated error26 float mag, magErr; // Magnitude and associated error27 float isoMag, isoMagErr; // Isophotal magnitude and associated error28 float fwhm, fwhmErr; // FWHM and associated error29 float ellipA, ellipB; // Elliptical semi-major (A) and semi-minor (B) axes30 float ellipAngle; // Ellipse position angle31 float sky, skyErr; // Local sky level, and associated error32 float colour, colourErr; // Colour and associated error, if known33 enum psColourRef colourRef; // Colour reference34 psBitMask *quality; // Bit mask for quality information24 psOTAPos *otaPos; //!< Centre position on OTA, with associated error 25 psSkyPos *skyPos; //!< Position on the sky, with associated error 26 float mag, magErr; //!< Magnitude and associated error 27 float isoMag, isoMagErr; //!< Isophotal magnitude and associated error 28 float fwhm, fwhmErr; //!< FWHM and associated error 29 float ellipA, ellipB; //!< Elliptical semi-major (A) and semi-minor (B) axes 30 float ellipAngle; //!< Ellipse position angle 31 float sky, skyErr; //!< Local sky level, and associated error 32 float colour, colourErr; //!< Colour and associated error, if known 33 enum psColourRef colourRef; //!< Colour reference 34 psBitMask *quality; //!< Bit mask for quality information 35 35 } psObject; 36 36 37 /* Constructor */37 /** Constructor */ 38 38 psObject * 39 39 psObjectNew(void); 40 40 41 /* Destructor */41 /** Destructor */ 42 42 void 43 43 psObjectDel(psObject *restrict myObject); … … 45 45 /***********************************************************************************************************/ 46 46 47 /* An assembly of objects */47 /** An assembly of objects */ 48 48 PS_DECLARE_ARRAY_TYPE(psObject); 49 49 PS_CREATE_ARRAY_TYPE(psObject); … … 51 51 /***********************************************************************************************************/ 52 52 53 /* Associates objects on an image with the image */53 /** Associates objects on an image with the image */ 54 54 typedef struct { 55 const psImage *image; // Image that produced the objects, which has metadata we need56 psObjectArray *objects; // The objects55 const psImage *image; //!< Image that produced the objects, which has metadata we need 56 psObjectArray *objects; //!< The objects 57 57 } psImageObjects; 58 58 59 /* Constructor */59 /** Constructor */ 60 60 psImageObjects * 61 psImageObjectsNew(const psImage *image, // Image that produced the objects, which has metadata we need62 psObjectArray *objects // The objects61 psImageObjectsNew(const psImage *image, //!< Image that produced the objects, which has metadata we need 62 psObjectArray *objects //!< The objects 63 63 ); 64 64 65 /* Destructor */65 /** Destructor */ 66 66 void 67 psImageObjectsDel(psImageObjects *restrict myImageObjects // Object to destroy67 psImageObjectsDel(psImageObjects *restrict myImageObjects //!< Object to destroy 68 68 ); 69 69 70 70 /***********************************************************************************************************/ 71 71 72 /* Objects from a catalogue */72 /** Objects from a catalogue */ 73 73 typedef struct { 74 enum psCatalogue catalogue; // Source catalogue from which objects come75 psObjectArray *object; // The objects74 enum psCatalogue catalogue; //!< Source catalogue from which objects come 75 psObjectArray *object; //!< The objects 76 76 } psCatalogueObjects; 77 77 78 /* Constructor */78 /** Constructor */ 79 79 psCatalogueObjects * 80 psCatalogueObjectsNew(enum psCatalogue *catalogue, // Source catalogue81 psObjectArray *objects // The objects80 psCatalogueObjectsNew(enum psCatalogue *catalogue, //!< Source catalogue 81 psObjectArray *objects //!< The objects 82 82 ); 83 83 84 /* Destructor */84 /** Destructor */ 85 85 void 86 psCatalogueObjectsDel(psCatalogeObjects *restrict myCatalogueObjects // Object to destroy86 psCatalogueObjectsDel(psCatalogeObjects *restrict myCatalogueObjects //!< Object to destroy 87 87 ); 88 88 89 89 /***********************************************************************************************************/ 90 90 91 /* A "super" object --- an object with multiple detections in different images */91 /** A "super" object --- an object with multiple detections in different images */ 92 92 typedef struct { 93 const psImageArray *images; // Images that provided the different measurements94 const psObjectArray *objects; // Individual object measurements93 const psImageArray *images; //!< Images that provided the different measurements 94 const psObjectArray *objects; //!< Individual object measurements 95 95 96 96 /* Derived quantities */ 97 psSkyPos *meanSkyPos; // Mean position on the sky98 double pmRA, pmDec; // Proper motion in RA and Dec99 double pmRAErr, pmDecErr; // Errors in proper motion100 float posChi2; // chi^2 for position97 psSkyPos *meanSkyPos; //!< Mean position on the sky 98 double pmRA, pmDec; //!< Proper motion in RA and Dec 99 double pmRAErr, pmDecErr; //!< Errors in proper motion 100 float posChi2; //!< chi^2 for position 101 101 } psSuperObject; 102 102 103 /* Constructor */103 /** Constructor */ 104 104 psSuperObject * 105 psSuperObjectNew(const psImageArray *images, // The images with the measurements106 const psObjectArray *objects // Object measurements105 psSuperObjectNew(const psImageArray *images, //!< The images with the measurements 106 const psObjectArray *objects //!< Object measurements 107 107 ); 108 108 109 /* Destructor */109 /** Destructor */ 110 110 void 111 psSuperObjectDel(psSuperObject *restrict mySuperObject // Object to destroy111 psSuperObjectDel(psSuperObject *restrict mySuperObject //!< Object to destroy 112 112 ); 113 113 … … 118 118 119 119 120 /* Correlate two OTA object arrays */ 121 /* 120 /** Correlate two OTA object arrays. 122 121 * Returns an array with the indices of the object in the second bunch that matched the corresponding object 123 122 * in the first bunch, or -1 if none that match. 124 123 */ 125 124 psIntArray * 126 psCorrelateObjects(const psObjectArray *restrict myObjects1, // First bunch of objects127 const psObjectArray *restrict myObjects2, // Second bunch of objects128 const psOTADescription *myOTA1, // OTA description for first bunch of objects, or NULL for129 // sky130 const psOTADescription *myOTA2 // OTA description for second bunch of objects, or NULL for131 // sky125 psCorrelateObjects(const psObjectArray *restrict myObjects1, //!< First bunch of objects 126 const psObjectArray *restrict myObjects2, //!< Second bunch of objects 127 const psOTADescription *myOTA1, //!< OTA description for first bunch of objects, or NULL for 128 //!< sky 129 const psOTADescription *myOTA2 //!< OTA description for second bunch of objects, or NULL for 130 //!< sky 132 131 ); 133 132 134 133 135 /* Get matched lists from a correlated index array */ 136 /* Returns a status number, and matched1 and matched2 are manipulated to contain matches */ 134 /** Get matched lists from a correlated index array Returns a status number, and matched1 and matched2 135 * are manipulated to contain matches 136 */ 137 137 int 138 psGetCorrelatedMatches(const psIntArray matches, // Index array specifying matches */139 const psObjectArray *restrict myObjects1, // First bunch of objects140 const psObjectArray *restrict myObjects2, // Second bunch of objects141 psObjectArray *matched1, // Matched objects in first bunch142 psObjectArray *matched2 // Matched objects in second bunch138 psGetCorrelatedMatches(const psIntArray matches, //!< Index array specifying matches */ 139 const psObjectArray *restrict myObjects1, //!< First bunch of objects 140 const psObjectArray *restrict myObjects2, //!< Second bunch of objects 141 psObjectArray *matched1, //!< Matched objects in first bunch 142 psObjectArray *matched2 //!< Matched objects in second bunch 143 143 ); 144 144 … … 147 147 /* Object selection */ 148 148 149 /* Get objects within a particular magnitude range */149 /** Get objects within a particular magnitude range */ 150 150 psObjectArray * 151 psSelectObjectMag(psObjectArray *restrict myArray, // Bunch of objects to select from152 float magLower, // Lower bound for magnitude153 float magUpper // Upper bound for magnitude151 psSelectObjectMag(psObjectArray *restrict myArray, //!< Bunch of objects to select from 152 float magLower, //!< Lower bound for magnitude 153 float magUpper //!< Upper bound for magnitude 154 154 ); 155 155 156 /* Get objects within a radius on the sky */156 /** Get objects within a radius on the sky */ 157 157 psObjectArray * 158 psSelectObjectSkyDist(psObjectArray *restrict myArray, // Bunch of objects to select from159 psSkyPos *skyPos, // Position on the sky160 float radius, // Radius of search161 int circleOrSquare // Circle = 1, Square = 2158 psSelectObjectSkyDist(psObjectArray *restrict myArray, //!< Bunch of objects to select from 159 psSkyPos *skyPos, //!< Position on the sky 160 float radius, //!< Radius of search 161 int circleOrSquare //!< Circle = 1, Square = 2 162 162 ); 163 163 164 /* Get objects within a particular colour range */164 /** Get objects within a particular colour range */ 165 165 psObjectArray * 166 psSelectObjectColour(psObjectArray *restrict myArray, // Bunch of objects to select from167 float magLower, // Lower bound for colour168 float magUpper, // Upper bound for colour169 enum psColourRef colourRef // Only select those with this colour reference166 psSelectObjectColour(psObjectArray *restrict myArray, //!< Bunch of objects to select from 167 float magLower, //!< Lower bound for colour 168 float magUpper, //!< Upper bound for colour 169 enum psColourRef colourRef //!< Only select those with this colour reference 170 170 ); 171 171 -
trunk/archive/pslib/include/psPosition.h
r149 r153 7 7 /***********************************************************************************************************/ 8 8 9 /* Magic values for errors */9 /** Magic values for errors */ 10 10 enum { 11 PS_NO_VALUE = -111.0, // Corresponding value not yet measured12 PS_NO_ERROR = -222.0 // Corresponding value has no error11 PS_NO_VALUE = -111.0, //!< Corresponding value not yet measured 12 PS_NO_ERROR = -222.0 //!< Corresponding value has no error 13 13 }; 14 14 15 15 /***********************************************************************************************************/ 16 16 17 /* Planets */17 /** Planets */ 18 18 enum { 19 19 PS_MERCURY = 1, … … 27 27 } psPlanetNum; 28 28 29 /* Catalogues */29 /** Catalogues */ 30 30 enum { 31 PS_PANSTARRS, // Pan-STARRS object catalogue32 PS_USNO, // USNO-B1 catalogue33 PS_2MASS, // 2MASS catalogue34 PS_TYCHO, // Tycho catalogue35 UCAC2 = 4 //UCAC2 catalogue31 PS_PANSTARRS, //!< Pan-STARRS object catalogue 32 PS_USNO, //!< USNO-B1 catalogue 33 PS_2MASS, //!< 2MASS catalogue 34 PS_TYCHO, //!< Tycho catalogue 35 PS_UCAC2 = 4 //!< UCAC2 catalogue 36 36 } psCatalogue; 37 37 38 38 /***********************************************************************************************************/ 39 39 40 /* A position on a detector */40 /** A position on a detector */ 41 41 typedef struct { 42 int chip; // Chip number43 float x; // x position44 float xErr; // Error in x position45 float y; // y position46 float yErr; // Error in y position42 int chip; //!< Chip number 43 float x; //!< x position 44 float xErr; //!< Error in x position 45 float y; //!< y position 46 float yErr; //!< Error in y position 47 47 } psOTAPos; 48 48 49 /* Constructor */49 /** Constructor */ 50 50 psOTAPos * 51 51 psOTAPosNew(void); 52 52 53 /* Destructor */53 /** Destructor */ 54 54 void 55 psOTAPosDel(psOTAPos *restrict myOTAPos // Object to destroy55 psOTAPosDel(psOTAPos *restrict myOTAPos //!< Object to destroy 56 56 ); 57 57 58 58 /***********************************************************************************************************/ 59 59 60 /* An array of detector positions */60 /** An array of detector positions */ 61 61 PS_DECLARE_ARRAY_TYPE(psOTAPos); 62 62 PS_CREATE_ARRAY_TYPE(psOTAPos); … … 64 64 /***********************************************************************************************************/ 65 65 66 /* A simple RA/Dec position on the sky, default system is ICRS. */ 67 /* Double precision needed for milli-arcsec */ 66 /* 67 * \brief A simple RA/Dec position on the sky, default system is ICRS. Double precision needed for 68 * milli-arcsec. 69 */ 68 70 typedef struct { 69 double ra; // Right Ascension70 double raErr; // Error in RA71 double dec; // Declination72 double decErr; // Error in Dec71 double ra; //!< Right Ascension 72 double raErr; //!< Error in RA 73 double dec; //!< Declination 74 double decErr; //!< Error in Dec 73 75 } psSkyPos; 74 76 75 /* Constructor */77 /** Constructor */ 76 78 psSkyPos * 77 79 psSkyPosNew(void); 78 80 79 /* Destructor */81 /** Destructor */ 80 82 void 81 psSkyPosDel(psSkyPos *restrict mySkyPos // Object to destroy83 psSkyPosDel(psSkyPos *restrict mySkyPos //!< Object to destroy 82 84 ); 83 85 84 86 /***********************************************************************************************************/ 85 87 86 /* An array of sky positions */88 /** An array of sky positions */ 87 89 PS_DECLARE_ARRAY_TYPE(psSkyPos); 88 90 PS_CREATE_ARRAY_TYPE(psSkyPos); … … 90 92 /***********************************************************************************************************/ 91 93 92 /* Latitude and Longitude. */ 93 /* Double precision needed for milli-arcsec */ 94 /** Latitude and Longitude. Double precision needed for milli-arcsec */ 94 95 typedef struct { 95 double lat; // Latitude96 double latErr; // Error in Latitude97 double lng; // Longitude (can't use "long")98 double lngErr; // Error in Longitude96 double lat; //!< Latitude 97 double latErr; //!< Error in Latitude 98 double lng; //!< Longitude (can't use "long") 99 double lngErr; //!< Error in Longitude 99 100 } psLatLong; 100 101 101 /* Constructor */102 /** Constructor */ 102 103 psLatLong * 103 104 psLatLongNew(void); 104 105 105 /* Destructor */106 /** Destructor */ 106 107 void 107 psLatLongDel(psLatLong *restrict myLatLong // Object to destroy108 psLatLongDel(psLatLong *restrict myLatLong //!< Object to destroy 108 109 ); 109 110 … … 112 113 /* Offsets */ 113 114 114 /* Get offset (RA,Dec) on the sky between two positions */ 115 /* position1 and position2 may not be identical */ 115 /** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */ 116 116 psSkyPos * 117 psGetOffset(const psSkyPos *restrict position1, // Position 1118 const psSkyPos *restrict position2 // Position 2117 psGetOffset(const psSkyPos *restrict position1, //!< Position 1 118 const psSkyPos *restrict position2 //!< Position 2 119 119 ); 120 120 121 /* Apply an offset to a position */121 /** Apply an offset to a position */ 122 122 psSkyPos * 123 psApplyOffset(const psSkyPos *restrict position, // Position124 const psSkyPos *restrict offset // Offset123 psApplyOffset(const psSkyPos *restrict position, //!< Position 124 const psSkyPos *restrict offset //!< Offset 125 125 ); 126 126 … … 129 129 /* Positions of well-known objects */ 130 130 131 /* Get Sun Position */131 /** Get Sun Position */ 132 132 psSkyPos * 133 psGetSunPos(float mjd // MJD to get position for133 psGetSunPos(float mjd //!< MJD to get position for 134 134 ); 135 135 136 /* Get Moon position */136 /** Get Moon position */ 137 137 psSkyPos * 138 psGetMoonPos(float mjd, // MJD to get position for139 double latitude, // Latitude for apparent position140 double longitude // Longitude for apparent position138 psGetMoonPos(float mjd, //!< MJD to get position for 139 double latitude, //!< Latitude for apparent position 140 double longitude //!< Longitude for apparent position 141 141 ); 142 142 143 /* Get Moon phase */143 /** Get Moon phase */ 144 144 float 145 psGetMoonPhase(float mjd // MJD to get phase for145 psGetMoonPhase(float mjd //!< MJD to get phase for 146 146 ); 147 147 148 /* Get Planet positions */148 /** Get Planet positions */ 149 149 psSkyPos * 150 psGetPlanetPos(enum psPlanetNum myPlanetNum, // Number for planet151 float mjd // MJD to get position for150 psGetPlanetPos(enum psPlanetNum myPlanetNum, //!< Number for planet 151 float mjd //!< MJD to get position for 152 152 ); 153 153 154 /* Get star list from catalogue */154 /** Get star list from catalogue */ 155 155 psObjectArray * 156 psReadStarCatalogue(double ra, // RA of centre of search157 double dec, // Declination of centre of search158 float radius, // Radius of search for stars in catalogue159 float mjd, // The epoch (in MJD) for which to get positions160 enum psCatalogue myCatalogue // The catalogue to use156 psReadStarCatalogue(double ra, //!< RA of centre of search 157 double dec, //!< Declination of centre of search 158 float radius, //!< Radius of search for stars in catalogue 159 float mjd, //!< The epoch (in MJD) for which to get positions 160 enum psCatalogue myCatalogue //!< The catalogue to use 161 161 ); 162 162 … … 165 165 /* Celestial coordinate conversions */ 166 166 167 /* Convert ICRS to Ecliptic */167 /** Convert ICRS to Ecliptic */ 168 168 psLatLong * 169 psCoordinatesItoE(const psSkyPos *restrict coordinates // ICRS coordinates to convert169 psCoordinatesItoE(const psSkyPos *restrict coordinates //!< ICRS coordinates to convert 170 170 ); 171 171 172 /* Convert Ecliptic to ICRS */172 /** Convert Ecliptic to ICRS */ 173 173 psSkyPos * 174 psCoordinatesEtoI(const psLatLong *restrict coordinates // Ecliptic coordinates to convert174 psCoordinatesEtoI(const psLatLong *restrict coordinates //!< Ecliptic coordinates to convert 175 175 ); 176 176 177 /* Convert ICRS to Galactic */177 /** Convert ICRS to Galactic */ 178 178 psLatLong * 179 psCoordinatesItoG(const psSkyPos *restrict coordinates // ICRS coordinates to convert179 psCoordinatesItoG(const psSkyPos *restrict coordinates //!< ICRS coordinates to convert 180 180 ); 181 181 182 /* Convert Galactic to ICRS */182 /** Convert Galactic to ICRS */ 183 183 psSkyPos * 184 psCoordinatesGtoI(const psLatLong *restrict coordinates // Galactic coordinates to convert184 psCoordinatesGtoI(const psLatLong *restrict coordinates //!< Galactic coordinates to convert 185 185 ); 186 186 -
trunk/archive/pslib/include/psSort.h
r149 r153 6 6 /* Sorting */ 7 7 8 /* Sort an array */ 9 /* Inputs not restrict-ed to allow sort in place */ 8 /** Sort an array. Inputs not restrict-ed to allow sort in place */ 10 9 psFloatArray * 11 psSort(psFloatArray *out, // Sorted array to return. May be NULL12 const psFloatArray *myArray // Array to sort10 psSort(psFloatArray *out, //!< Sorted array to return. May be NULL 11 const psFloatArray *myArray //!< Array to sort 13 12 ); 14 13 15 /* Sort an array, along with some other stuff */ 16 /* Returns an index array */ 14 /** Sort an array, along with some other stuff. Returns an index array */ 17 15 psIntArray * 18 psCoSort(psIntArray *restrict out; // Output index array (may be NULL)19 const psFloatArray *restrict myArray // Array to sort16 psCoSort(psIntArray *restrict out; //!< Output index array (may be NULL) 17 const psFloatArray *restrict myArray //!< Array to sort 20 18 ); 21 19 -
trunk/archive/pslib/include/psStats.h
r149 r153 5 5 #include "psStdArrays.h" 6 6 7 /* Do Statistics on an array. Returns a status value. */7 /** Do Statistics on an array. Returns a status value. */ 8 8 int 9 psArrayStats(const psFloatArray *restrict myArray, // Array to be analysed10 const psIntArray *restrict maskArray, // Ignore elements where (maskArray & maskVal) != 011 // May be NULL12 unsigned int maskVal, // Only mask elements with one of these bits set in maskArray13 int numIter, // Number of clipping iterations (0 not to clip)14 float numSD, // Number of s.d. to clip at15 float *restrict mean, // Mean of array (or NULL)16 float *restrict sd, // Standard deviation (or NULL)17 float *restrict med // Median (or NULL)9 psArrayStats(const psFloatArray *restrict myArray, //!< Array to be analysed 10 const psIntArray *restrict maskArray, //!< Ignore elements where (maskArray & maskVal) != 0 11 //!< May be NULL 12 unsigned int maskVal, //!< Only mask elements with one of these bits set in maskArray 13 int numIter, //!< Number of clipping iterations (0 not to clip) 14 float numSD, //!< Number of s.d. to clip at 15 float *restrict mean, //!< Mean of array (or NULL) 16 float *restrict sd, //!< Standard deviation (or NULL) 17 float *restrict med //!< Median (or NULL) 18 18 ); 19 19 20 20 /***********************************************************************************************************/ 21 21 22 /* Histograms */22 /** Histograms */ 23 23 typedef struct { 24 const psFloatArray *restrict lower, *restrict upper; // Lower and upper bounds for the bins25 psIntArray *nums; // Number in each of the bins26 const float minVal, maxVal; // Minimum and maximum values27 int minNum, maxNum; // Number below the minimum and above the maximum24 const psFloatArray *restrict lower, *restrict upper; //!< Lower and upper bounds for the bins 25 psIntArray *nums; //!< Number in each of the bins 26 const float minVal, maxVal; //!< Minimum and maximum values 27 int minNum, maxNum; //!< Number below the minimum and above the maximum 28 28 } psHistogram; 29 29 30 30 31 /* Constructor */31 /** Constructor */ 32 32 psHistogram * 33 psHistogramNew(float lower, // Lower limit for the bins34 float upper, // Upper limit for the bins35 float size // Size of the bins33 psHistogramNew(float lower, //!< Lower limit for the bins 34 float upper, //!< Upper limit for the bins 35 float size //!< Size of the bins 36 36 ); 37 37 38 /* Generic constructor */38 /** Generic constructor */ 39 39 psHistogram * 40 psHistogramNewGeneric(const psFloatArray *restrict lower, // Lower bounds for the bins41 const psFloatArray *restrict upper, // Upper bounds for the bins42 float minVal, // Minimum value43 float maxVal // Maximum value40 psHistogramNewGeneric(const psFloatArray *restrict lower, //!< Lower bounds for the bins 41 const psFloatArray *restrict upper, //!< Upper bounds for the bins 42 float minVal, //!< Minimum value 43 float maxVal //!< Maximum value 44 44 ); 45 45 46 /* Destructor */46 /** Destructor */ 47 47 void 48 psHistogramDel(psHistogram *restrict myHist // Histogram to destroy48 psHistogramDel(psHistogram *restrict myHist //!< Histogram to destroy 49 49 ); 50 50 51 51 52 /* Calculate a histogram */52 /** Calculate a histogram */ 53 53 psHistogram * 54 psGetArrayHistogram(psHistogram *restrict myHist, // Histogram data55 const psFloatArray *restrict myArray // Array to analyse54 psGetArrayHistogram(psHistogram *restrict myHist, //!< Histogram data 55 const psFloatArray *restrict myArray //!< Array to analyse 56 56 ); 57 57 -
trunk/archive/pslib/include/psStdArrays.h
r149 r153 4 4 #include "psArray.h" 5 5 6 /* ps- typedefs so that array names comply with the standard naming convention */ 7 /* These should not be used generally. */ 6 /** 7 * ps- typedefs so that array names comply with the standard naming convention. These should NOT be used 8 * generally. 9 */ 8 10 typedef float psFloat; 9 11 typedef int psInt; … … 11 13 typedef double psDouble; 12 14 13 /* An array of real numbers */15 /** An array of real numbers */ 14 16 PS_DECLARE_ARRAY_TYPE(psFloat); 15 17 PS_CREATE_ARRAY_TYPE(psFloat); 16 18 17 /* An array of complex numbers */19 /** An array of complex numbers */ 18 20 PS_DECLARE_ARRAY_TYPE(psComplex); 19 21 PS_CREATE_ARRAY_TYPE(psComplex); 20 22 21 /* An array of integers */23 /** An array of integers */ 22 24 PS_DECLARE_ARRAY_TYPE(psInt); 23 25 PS_CREATE_ARRAY_TYPE(psInt); 24 26 25 /* An array of double-precision real numbers */27 /** An array of double-precision real numbers */ 26 28 PS_DECLARE_ARRAY_TYPE(psDouble); 27 29 PS_CREATE_ARRAY_TYPE(psDouble);
Note:
See TracChangeset
for help on using the changeset viewer.
