Changeset 28759
- Timestamp:
- Jul 28, 2010, 4:22:32 PM (16 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 4 edited
-
config/test/map.xml (modified) (1 diff)
-
config/test/tables.xml (modified) (2 diffs)
-
src/ippToPspsBatchTest.c (modified) (9 diffs)
-
src/ippToPspsTestEnums.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/config/test/map.xml
r28556 r28759 3 3 <tabledata> 4 4 5 <table name="FrameMeta">6 <map ippName="ZPT_ERR" ippType="TFLOAT" pspsName="photoScat" />7 <map ippName="MJD-OBS" ippType="TFLOAT" pspsName="expStart" />8 <map ippName="EXPREQ" ippType="TFLOAT" pspsName="expTime" />9 <map ippName="AIRMASS" ippType="TFLOAT" pspsName="airmass" />10 <map ippName="RA" ippType="TDOUBLE" pspsName="raBore" />11 <map ippName="DEC" ippType="TDOUBLE" pspsName="decBore" />12 <map ippName="CTYPE1" ippType="TSTRING" pspsName="ctype1" />13 <map ippName="CTYPE2" ippType="TSTRING" pspsName="ctype2" />14 <map ippName="CRVAL1" ippType="TDOUBLE" pspsName="crval1" />15 <map ippName="CRVAL2" ippType="TDOUBLE" pspsName="crval2" />16 <map ippName="CRPIX1" ippType="TDOUBLE" pspsName="crpix1" />17 <map ippName="CRPIX2" ippType="TDOUBLE" pspsName="crpix2" />18 <map ippName="CDELT1" ippType="TDOUBLE" pspsName="cdelt1" />19 <map ippName="CDELT2" ippType="TDOUBLE" pspsName="cdelt2" />20 <map ippName="PC001001" ippType="TDOUBLE" pspsName="pc001001" />21 <map ippName="PC001002" ippType="TDOUBLE" pspsName="pc001002" />22 <map ippName="PC002001" ippType="TDOUBLE" pspsName="pc002001" />23 <map ippName="PC002002" ippType="TDOUBLE" pspsName="pc002002" />24 <map ippName="NPLYTERM" ippType="TBYTE" pspsName="polyOrder" />25 <map ippName="PCA1X3Y0" ippType="TDOUBLE" pspsName="pca1x3y0" />26 <map ippName="PCA1X2Y1" ippType="TDOUBLE" pspsName="pca1x2y1" />27 <map ippName="PCA1X1Y2" ippType="TDOUBLE" pspsName="pca1x1y2" />28 <map ippName="PCA1X0Y3" ippType="TDOUBLE" pspsName="pca1x0y3" />29 <map ippName="PCA1X2Y0" ippType="TDOUBLE" pspsName="pca1x2y0" />30 <map ippName="PCA1X1Y1" ippType="TDOUBLE" pspsName="pca1x1y1" />31 <map ippName="PCA1X0Y2" ippType="TDOUBLE" pspsName="pca1x0y2" />32 <map ippName="PCA2X3Y0" ippType="TDOUBLE" pspsName="pca2x3y0" />33 <map ippName="PCA2X2Y1" ippType="TDOUBLE" pspsName="pca2x2y1" />34 <map ippName="PCA2X1Y2" ippType="TDOUBLE" pspsName="pca2x1y2" />35 <map ippName="PCA2X0Y3" ippType="TDOUBLE" pspsName="pca2x0y3" />36 <map ippName="PCA2X2Y0" ippType="TDOUBLE" pspsName="pca2x2y0" />37 <map ippName="PCA2X1Y1" ippType="TDOUBLE" pspsName="pca2x1y1" />38 <map ippName="PCA2X0Y2" ippType="TDOUBLE" pspsName="pca2x0y2" />39 </table>40 41 <table name="ImageMeta">42 <map ippName="MSKY_MN" ippType="TFLOAT" pspsName="sky" />43 <map ippName="MSKY_SIG" ippType="TFLOAT" pspsName="skyScat" />44 <map ippName="FSATUR" ippType="TFLOAT" pspsName="magSat" />45 <map ippName="FLIMIT" ippType="TFLOAT" pspsName="completMag" />46 <map ippName="CERROR" ippType="TFLOAT" pspsName="astroScat" />47 <map ippName="NASTRO" ippType="TLONG" pspsName="numAstroRef" />48 <map ippName="CNAXIS1" ippType="TSHORT" pspsName="nx" />49 <map ippName="CNAXIS2" ippType="TSHORT" pspsName="ny" />50 <map ippName="FWHM_MAJ" ippType="TFLOAT" pspsName="psfWidMajor" />51 <map ippName="FWHM_MIN" ippType="TFLOAT" pspsName="psfWidMinor" />52 <map ippName="ANGLE" ippType="TFLOAT" pspsName="psfTheta" />53 <map ippName="APMIFIT" ippType="TFLOAT" pspsName="apResid" />54 <map ippName="DAPMIFIT" ippType="TFLOAT" pspsName="dapResid" />55 <map ippName="CTYPE1" ippType="TSTRING" pspsName="ctype1" />56 <map ippName="CTYPE2" ippType="TSTRING" pspsName="ctype2" />57 <map ippName="CRVAL1" ippType="TDOUBLE" pspsName="crval1" />58 <map ippName="CRVAL2" ippType="TDOUBLE" pspsName="crval2" />59 <map ippName="CRPIX1" ippType="TDOUBLE" pspsName="crpix1" />60 <map ippName="CRPIX2" ippType="TDOUBLE" pspsName="crpix2" />61 <map ippName="CDELT1" ippType="TDOUBLE" pspsName="cdelt1" />62 <map ippName="CDELT2" ippType="TDOUBLE" pspsName="cdelt2" />63 <map ippName="PC001001" ippType="TDOUBLE" pspsName="pc001001" />64 <map ippName="PC001002" ippType="TDOUBLE" pspsName="pc001002" />65 <map ippName="PC002001" ippType="TDOUBLE" pspsName="pc002001" />66 <map ippName="PC002002" ippType="TDOUBLE" pspsName="pc002002" />67 <map ippName="NPLYTERM" ippType="TBYTE" pspsName="polyOrder" />68 <map ippName="PCA1X3Y0" ippType="TDOUBLE" pspsName="pca1x3y0" />69 <map ippName="PCA1X2Y1" ippType="TDOUBLE" pspsName="pca1x2y1" />70 <map ippName="PCA1X1Y2" ippType="TDOUBLE" pspsName="pca1x1y2" />71 <map ippName="PCA1X0Y3" ippType="TDOUBLE" pspsName="pca1x0y3" />72 <map ippName="PCA1X2Y0" ippType="TDOUBLE" pspsName="pca1x2y0" />73 <map ippName="PCA1X1Y1" ippType="TDOUBLE" pspsName="pca1x1y1" />74 <map ippName="PCA1X0Y2" ippType="TDOUBLE" pspsName="pca1x0y2" />75 <map ippName="PCA2X3Y0" ippType="TDOUBLE" pspsName="pca2x3y0" />76 <map ippName="PCA2X2Y1" ippType="TDOUBLE" pspsName="pca2x2y1" />77 <map ippName="PCA2X1Y2" ippType="TDOUBLE" pspsName="pca2x1y2" />78 <map ippName="PCA2X0Y3" ippType="TDOUBLE" pspsName="pca2x0y3" />79 <map ippName="PCA2X2Y0" ippType="TDOUBLE" pspsName="pca2x2y0" />80 <map ippName="PCA2X1Y1" ippType="TDOUBLE" pspsName="pca2x1y1" />81 <map ippName="PCA2X0Y2" ippType="TDOUBLE" pspsName="pca2x0y2" />82 </table>83 84 5 <table name="Detection"> 85 <map ippName="X_PSF" ippType="TFLOAT" pspsName="xPos" /> 86 <map ippName="Y_PSF" ippType="TFLOAT" pspsName="yPos" /> 87 <map ippName="X_PSF_SIG" ippType="TFLOAT" pspsName="xPosErr" /> 88 <map ippName="Y_PSF_SIG" ippType="TFLOAT" pspsName="yPosErr" /> 89 <map ippName="RA_PSF" ippType="TFLOAT" pspsName="ippRa" /> 90 <map ippName="DEC_PSF" ippType="TFLOAT" pspsName="ippDec" /> 91 <map ippName="PSF_MAJOR" ippType="TFLOAT" pspsName="psfWidMajor" /> 92 <map ippName="PSF_MINOR" ippType="TFLOAT" pspsName="psfWidMinor" /> 93 <map ippName="PSF_THETA" ippType="TFLOAT" pspsName="psfTheta" /> 94 <map ippName="PSF_QF" ippType="TFLOAT" pspsName="psfCf" /> 95 <map ippName="SKY" ippType="TFLOAT" pspsName="sky" /> 96 <map ippName="SKY_SIGMA" ippType="TFLOAT" pspsName="skyErr" /> 6 <map ippName="RA_PSF" ippType="TFLOAT" pspsName="ra" /> 7 <map ippName="DEC_PSF" ippType="TFLOAT" pspsName="dec" /> 97 8 </table> 98 9 -
trunk/ippToPsps/config/test/tables.xml
r28662 r28759 2 2 3 3 <tableDescriptions type="det"> 4 <table name="FrameMeta">5 <column name="frameID" type="TLONG" default="0" comment="unique exposure/frame identifier."></column>6 <column name="filterID" type="TBYTE" default="0" comment="filter identifier"></column>7 <column name="nOTA" type="TSHORT" default="-999" comment="number of valid OTA/CCD images in this exposure"></column>8 <column name="photoScat" type="TFLOAT" default="-999" comment=" global photometric scatter (unit = mag)"></column>9 <column name="expStart" type="TDOUBLE" default="-999" comment=" exposure start time in MJD (unit = day)"></column>10 <column name="expTime" type="TFLOAT" default="-999" comment=" exposure time (unit = s)"></column>11 <column name="airmass" type="TFLOAT" default="-999" comment="airmass at mid-exposure"></column>12 <column name="raBore" type="TDOUBLE" default="-999" comment=" RA of telescope boresight (unit = deg)"></column>13 <column name="decBore" type="TDOUBLE" default="-999" comment=" DEC of telescope boresight (unit = deg)"></column>14 <column name="ctype1" type="TSTRING" default=" " comment="name of astrometric projection in RA"></column>15 <column name="ctype2" type="TSTRING" default=" " comment="name of astrometric projection in DEC"></column>16 <column name="crval1" type="TDOUBLE" default="-999" comment=" RA corresponding to reference pixel (unit = deg)"></column>17 <column name="crval2" type="TDOUBLE" default="-999" comment=" DEC corresponding to reference pixel (unit = deg)"></column>18 <column name="crpix1" type="TDOUBLE" default="-999" comment="reference pixel value for RA"></column>19 <column name="crpix2" type="TDOUBLE" default="-999" comment="reference pixel value for DEC"></column>20 <column name="cdelt1" type="TDOUBLE" default="-999" comment=""></column>21 <column name="cdelt2" type="TDOUBLE" default="-999" comment=""></column>22 <column name="pc001001" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>23 <column name="pc001002" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>24 <column name="pc002001" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>25 <column name="pc002002" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>26 <column name="polyOrder" type="TBYTE" default="255" comment="polynomial order of astrometry fit"></column>27 <column name="pca1x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>28 <column name="pca1x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>29 <column name="pca1x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>30 <column name="pca1x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>31 <column name="pca1x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>32 <column name="pca1x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>33 <column name="pca1x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>34 <column name="pca2x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>35 <column name="pca2x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>36 <column name="pca2x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>37 <column name="pca2x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>38 <column name="pca2x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>39 <column name="pca2x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>40 <column name="pca2x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>41 </table>42 <table name="ImageMeta">43 <column name="photoCalID" type="TLONG" default="0" comment="photometry reduction code identifier"></column>44 <column name="filterID" type="TBYTE" default="0" comment="filter ID"></column>45 <column name="sky" type="TFLOAT" default="-999" comment=" mean sky level (unit = ADU)"></column>46 <column name="skyScat" type="TFLOAT" default="-999" comment=" scatter in mean sky level (unit = ADU)"></column>47 <column name="nDetect" type="TLONG" default="-999" comment="number of detections on CCD"></column>48 <column name="magSat" type="TFLOAT" default="-999" comment=" saturation magnitude level (unit = mag)"></column>49 <column name="completMag" type="TFLOAT" default="-999" comment=" 95% completion level in mag (unit = mag)"></column>50 <column name="astroScat" type="TFLOAT" default="-999" comment=" astrometric scatter for chip (unit = mag)"></column>51 <column name="photoScat" type="TFLOAT" default="-999" comment="photometric scatter for chip"></column>52 <column name="numAstroRef" type="TLONG" default="-999" comment="number of astrometric reference sources"></column>53 <column name="nx" type="TSHORT" default="-999" comment="chip dimension in x"></column>54 <column name="ny" type="TSHORT" default="-999" comment="chip dimension in y"></column>55 <column name="psfModelID" type="TLONG" default="-999" comment="PSF model identifier"></column>56 <column name="psfFwhm" type="TFLOAT" default="-999" comment=" model psf full width at half maximum at chip center (unit = arcsec)"></column>57 <column name="psfWidMajor" type="TFLOAT" default="-999" comment=" model PSF parameters at chip center (unit = arcsec)"></column>58 <column name="psfWidMinor" type="TFLOAT" default="-999" comment=" model PSF parameters at chip center (unit = arcsec)"></column>59 <column name="psfTheta" type="TFLOAT" default="-999" comment=" model PSF parameters at chip center (unit = deg)"></column>60 <column name="apResid" type="TFLOAT" default="-999" comment="corrected aperture residual"></column>61 <column name="dapResid" type="TFLOAT" default="-999" comment="scatter of aperture corrections"></column>62 <column name="photoZero" type="TFLOAT" default="-999" comment=" local derived photometric zero point (unit = mag)"></column>63 <column name="qaFlags" type="TLONGLONG" default="-999" comment="Q/A flags for this OTA"></column>64 <column name="ctype1" type="TSTRING" default=" " comment="name of astrometric projection in RA"></column>65 <column name="ctype2" type="TSTRING" default=" " comment="name of astrometric projection in DEC"></column>66 <column name="crval1" type="TDOUBLE" default="-999" comment=" RA corresponding to reference pixel (unit = deg)"></column>67 <column name="crval2" type="TDOUBLE" default="-999" comment=" DEC corresponding to reference pixel (unit = deg)"></column>68 <column name="crpix1" type="TDOUBLE" default="-999" comment=" reference pixel value for RA (unit = pix)"></column>69 <column name="crpix2" type="TDOUBLE" default="-999" comment=" reference pixel value for DEC (unit = pix)"></column>70 <column name="cdelt1" type="TDOUBLE" default="-999" comment=""></column>71 <column name="cdelt2" type="TDOUBLE" default="-999" comment=""></column>72 <column name="pc001001" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>73 <column name="pc001002" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>74 <column name="pc002001" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>75 <column name="pc002002" type="TDOUBLE" default="-999" comment="elements of rotation/Dcale matrix"></column>76 <column name="polyOrder" type="TBYTE" default="255" comment="polynomial order of astrometry fit"></column>77 <column name="pca1x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>78 <column name="pca1x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>79 <column name="pca1x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>80 <column name="pca1x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>81 <column name="pca1x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>82 <column name="pca1x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>83 <column name="pca1x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>84 <column name="pca2x3y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>85 <column name="pca2x2y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>86 <column name="pca2x1y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>87 <column name="pca2x0y3" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>88 <column name="pca2x2y0" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>89 <column name="pca2x1y1" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>90 <column name="pca2x0y2" type="TDOUBLE" default="-999" comment="polynomial coefficients for the astrometric fit"></column>91 </table>92 4 <table name="Detection"> 93 5 <column name="objID" type="TLONGLONG" default="0" comment="ODM object identifier"></column> … … 96 8 <column name="ippDetectID" type="TLONGLONG" default="0" comment="detection id generated by IPP"></column> 97 9 <column name="filterID" type="TBYTE" default="0" comment="filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ..."></column> 98 <column name="xPos" type="TFLOAT" default="-999" comment=" measured x on CCD from PSF fit (unit = pix)"></column> 99 <column name="yPos" type="TFLOAT" default="-999" comment=" measured y on CCD from PSF fit (unit = pix)"></column> 100 <column name="xPosErr" type="TFLOAT" default="-999" comment=" estimated error in x (unit = pix)"></column> 101 <column name="yPosErr" type="TFLOAT" default="-999" comment=" estimated error in y (unit = pix)"></column> 102 <column name="ippRa" type="TFLOAT" default="-999" comment="RA"></column> 103 <column name="ippDec" type="TFLOAT" default="-999" comment="dec"></column> 10 <column name="imageID" type="TLONGLONG" default="0" comment="unique ID for each image, hashed from frameID and ccdID (ALEX)"></column> 11 <column name="ra" type="TFLOAT" default="-999" comment="RA"></column> 12 <column name="dec" type="TFLOAT" default="-999" comment="dec"></column> 13 <column name="infoFlag" type="TLONGLONG" default="-999" comment="flag indicating provenance information"></column> 104 14 <column name="instFlux" type="TFLOAT" default="-999" comment=" PSF instrumental flux (unit = adu/s)"></column> 105 <column name="instFluxErr" type="TFLOAT" default="-999" comment=" estimated error in flux (unit = adu/s)"></column>106 <column name="peakADU" type="TFLOAT" default="-999" comment=" peak count in source pixel (unit = adu)"></column>107 <column name="psfWidMajor" type="TFLOAT" default="-999" comment=" model PSF width in major axis (unit = arcsec)"></column>108 <column name="psfWidMinor" type="TFLOAT" default="-999" comment=" model PSF width in minor axis (unit = arcsec)"></column>109 <column name="psfTheta" type="TFLOAT" default="-999" comment=" model PSF orientation angle (unit = deg)"></column>110 <column name="psfCf" type="TFLOAT" default="-999" comment="PSF coverage factor"></column>111 <column name="infoFlag" type="TLONGLONG" default="-999" comment="flag indicating provenance information"></column>112 <column name="sky" type="TFLOAT" default="-999" comment=" PSF sky level at source (unit = adu)"></column>113 <column name="skyErr" type="TFLOAT" default="-999" comment=" estimated error in sky (unit = adu)"></column>114 15 </table> 115 16 </tableDescriptions> -
trunk/ippToPsps/src/ippToPspsBatchTest.c
r28662 r28759 13 13 #include "fitsio.h" 14 14 15 // Gets flux from magnitude 16 static __inline bool ippToPsps_getFlux(const float zeroPoint, const float exposureTime, const float magnitude, float* flux) { 17 18 // use uncalibrated instrumental flux 15 // Gets uncalibrated instrumental flux from magnitude 16 static __inline bool ippToPsps_getFlux(const float exposureTime, const float magnitude, float* flux, const float magnitudeErr, float* fluxErr) { 17 19 18 *flux = powf(10.0, -0.4*magnitude) / exposureTime; 20 21 // use calibrated flux in Janskys, where 3631 Jy is the zero point flux for the filter: constant over all filters because we're using AB magnitudes 22 //float flux = 3631 * powf(10.0, -0.4*(magnitude + zeroPoint)) / exposureTime; 23 24 // printf("mag=%f\texpTime=%f\tzeroPoint=%f\tflux=%f\n", magnitude, exposureTime, zeroPoint, flux); 25 return (!isfinite(*flux) || *flux < 0.000001) ? false : true; 19 if (!isfinite(*flux) || *flux < 0.000001) return false; 20 if (fluxErr) *fluxErr = fabsf((magnitudeErr * *flux)/1.085736); 21 // if (fluxErr) printf("Mag = %03.03f, Flux = %03.03f, Mag err = %03.03f, Flux Err = %03.03f\n", magnitude, *flux, magnitudeErr, *fluxErr); 22 23 return true; 26 24 } 27 25 … … 29 27 \brief test data for checking PSPS values correspond with IPP 30 28 31 */29 */ 32 30 int ippToPsps_batchTest(IppToPsps *this) { 33 31 … … 53 51 status=0; fits_read_key(fitsIn, TFLOAT, "EXPREQ", &exposureTime, NULL, &status); 54 52 status=0; fits_read_key(fitsIn, TSTRING, "FILTERID", filterType, NULL, &status); 55 56 ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "FrameMeta", true);53 54 // ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "FrameMeta", true); 57 55 58 56 // FrameMeta values 59 fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->expId, &status);57 // fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->expId, &status); 60 58 61 59 int8_t filterID = -1; 62 60 ippToPspsConfig_getFilterId(this->config, filterType, &filterID); 63 fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_FILTERID, 1, 1, 1, &filterID, &status);61 // fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_FILTERID, 1, 1, 1, &filterID, &status); 64 62 65 63 // stuff to keep from psf.hdr header … … 140 138 long removeList[MAXDETECT]; 141 139 long thisObjId; 142 bool firstTimeIn = true ;140 bool firstTimeIn = true, peakFluxOk, instFluxOk; 143 141 int ippIDetNum, instMagNum, instMagErrNum, peakMagNum; 144 142 … … 198 196 199 197 // create ImageMeta 200 ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "ImageMeta", true);198 // ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "ImageMeta", true); 201 199 psfFwhm = (fwhmMaj+fwhmMin)/2; 202 200 momentFwhm = (momentMaj+momentMin)/2; 203 201 imageFlags = (uint64_t)pImage->flags; 204 fits_write_col(this->fitsOut, TLONG, IMAGEMETA_PHOTOCALID, 1, 1, 1, &pImage->photcode, &status);205 fits_write_col(this->fitsOut, TBYTE, IMAGEMETA_FILTERID, 1, 1, 1, &filterID, &status);206 fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PHOTOSCAT, 1, 1, 1, &zptObs, &status);207 fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PSFFWHM, 1, 1, 1, &psfFwhm, &status);208 fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PHOTOZERO, 1, 1, 1, &zptObs, &status);209 fits_write_col(this->fitsOut, TLONGLONG, IMAGEMETA_QAFLAGS, 1, 1, 1, &imageFlags, &status);202 // fits_write_col(this->fitsOut, TLONG, IMAGEMETA_PHOTOCALID, 1, 1, 1, &pImage->photcode, &status); 203 // fits_write_col(this->fitsOut, TBYTE, IMAGEMETA_FILTERID, 1, 1, 1, &filterID, &status); 204 // fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PHOTOSCAT, 1, 1, 1, &zptObs, &status); 205 // fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PSFFWHM, 1, 1, 1, &psfFwhm, &status); 206 // fits_write_col(this->fitsOut, TFLOAT, IMAGEMETA_PHOTOZERO, 1, 1, 1, &zptObs, &status); 207 // fits_write_col(this->fitsOut, TLONGLONG, IMAGEMETA_QAFLAGS, 1, 1, 1, &imageFlags, &status); 210 208 211 209 // now move BACK to detections table in smf … … 287 285 obsTimes[s] = obsTime; 288 286 289 ippToPsps_getFlux(zeroPoint, exposureTime, instMagErr[s], &instFluxErr[s]); 287 peakFluxOk = ippToPsps_getFlux(exposureTime, peakMag[s], &peakFlux[s], 0.0, NULL); 288 instFluxOk = ippToPsps_getFlux(exposureTime, instMag[s], &instFlux[s], instMagErr[s], &instFluxErr[s]); 290 289 291 290 // check for invalid flux values (if not already labelled as a duplicate) 292 if ((!ippToPsps_getFlux(zeroPoint, exposureTime, peakMag[s], &peakFlux[s]) || 293 !ippToPsps_getFlux(zeroPoint, exposureTime, instMag[s], &instFlux[s])) && !isDuplicate) { 291 if ( (!peakFluxOk || !instFluxOk) && !isDuplicate) { 294 292 removeList[numOfDuplicates+numInvalidFlux] = s+1; 295 293 numInvalidFlux++; … … 314 312 // write number of rows (detections) to ImageMeta 315 313 numDetectionsOut = totalDetections - numOfDuplicates - numInvalidFlux; 316 fits_write_col(this->fitsOut, TLONG, IMAGEMETA_NDETECT, 1, 1, 1, &numDetectionsOut, &status);314 // fits_write_col(this->fitsOut, TLONG, IMAGEMETA_NDETECT, 1, 1, 1, &numDetectionsOut, &status); 317 315 318 316 // detections … … 323 321 fits_write_col(this->fitsOut, TLONGLONG, DETECTION_IPPDETECTID, 1, 1, nDet, ippDetectID, &status); 324 322 fits_write_col(this->fitsOut, TBYTE, DETECTION_FILTERID, 1, 1, nDet, filterIDs, &status); 323 fits_write_col(this->fitsOut, TLONGLONG, DETECTION_IMAGEID, 1, 1, nDet, imageID, &status); 325 324 fits_write_col(this->fitsOut, TFLOAT, DETECTION_INSTFLUX, 1, 1, nDet, instFlux, &status); 326 fits_write_col(this->fitsOut, TFLOAT, DETECTION_INSTFLUXERR, 1, 1, nDet, instFluxErr, &status);327 fits_write_col(this->fitsOut, TFLOAT, DETECTION_PEAKADU, 1, 1, nDet, peakFlux, &status);325 //fits_write_col(this->fitsOut, TFLOAT, DETECTION_INSTFLUXERR, 1, 1, nDet, instFluxErr, &status); 326 //fits_write_col(this->fitsOut, TFLOAT, DETECTION_PEAKADU, 1, 1, nDet, peakFlux, &status); 328 327 fits_write_col(this->fitsOut, TLONGLONG, DETECTION_INFOFLAG, 1, 1, nDet, flags, &status); 329 328 if (numOfDuplicates||numInvalidFlux) fits_delete_rowlist(this->fitsOut, removeList, numOfDuplicates+numInvalidFlux, &status); … … 346 345 // write number of images we have found into FrameMeta table 347 346 status=0; 348 if (fits_movnam_hdu(this->fitsOut, BINARY_TBL, "FrameMeta", 0, &status))349 psError(PS_ERR_IO, false, "Can't move back to FrameMeta extension to write number of OTAs\n");350 else351 fits_write_col(this->fitsOut, TSHORT, FRAMEMETA_NOTA, 1, 1, 1, &nOta, &status);347 //if (fits_movnam_hdu(this->fitsOut, BINARY_TBL, "FrameMeta", 0, &status)) 348 // psError(PS_ERR_IO, false, "Can't move back to FrameMeta extension to write number of OTAs\n"); 349 //else 350 // fits_write_col(this->fitsOut, TSHORT, FRAMEMETA_NOTA, 1, 1, 1, &nOta, &status); 352 351 353 352 status=0; -
trunk/ippToPsps/src/ippToPspsTestEnums.h
r28662 r28759 3 3 4 4 5 typedef enum {6 FRAMEMETA_FRAMEID = 1,7 FRAMEMETA_FILTERID,8 FRAMEMETA_NOTA,9 FRAMEMETA_PHOTOSCAT,10 FRAMEMETA_EXPSTART,11 FRAMEMETA_EXPTIME,12 FRAMEMETA_AIRMASS,13 FRAMEMETA_RABORE,14 FRAMEMETA_DECBORE,15 FRAMEMETA_CTYPE1,16 FRAMEMETA_CTYPE2,17 FRAMEMETA_CRVAL1,18 FRAMEMETA_CRVAL2,19 FRAMEMETA_CRPIX1,20 FRAMEMETA_CRPIX2,21 FRAMEMETA_PC001001,22 FRAMEMETA_PC001002,23 FRAMEMETA_PC002001,24 FRAMEMETA_PC002002,25 FRAMEMETA_POLYORDER,26 FRAMEMETA_PCA1X3Y0,27 FRAMEMETA_PCA1X2Y1,28 FRAMEMETA_PCA1X1Y2,29 FRAMEMETA_PCA1X0Y3,30 FRAMEMETA_PCA1X2Y0,31 FRAMEMETA_PCA1X1Y1,32 FRAMEMETA_PCA1X0Y2,33 FRAMEMETA_PCA2X3Y0,34 FRAMEMETA_PCA2X2Y1,35 FRAMEMETA_PCA2X1Y2,36 FRAMEMETA_PCA2X0Y3,37 FRAMEMETA_PCA2X2Y0,38 FRAMEMETA_PCA2X1Y1,39 FRAMEMETA_PCA2X0Y2,40 } FrameMeta;41 42 typedef enum {43 IMAGEMETA_PHOTOCALID = 1,44 IMAGEMETA_FILTERID,45 IMAGEMETA_SKY,46 IMAGEMETA_SKYSCAT,47 IMAGEMETA_NDETECT,48 IMAGEMETA_MAGSAT,49 IMAGEMETA_COMPLETMAG,50 IMAGEMETA_ASTROSCAT,51 IMAGEMETA_PHOTOSCAT,52 IMAGEMETA_NUMASTROREF,53 IMAGEMETA_NX,54 IMAGEMETA_NY,55 IMAGEMETA_PSFMODELID,56 IMAGEMETA_PSFFWHM,57 IMAGEMETA_PSFWIDMAJOR,58 IMAGEMETA_PSFWIDMINOR,59 IMAGEMETA_PSFTHETA,60 IMAGEMETA_APRESID,61 IMAGEMETA_DAPRESID,62 IMAGEMETA_PHOTOZERO,63 IMAGEMETA_QAFLAGS,64 IMAGEMETA_CTYPE1,65 IMAGEMETA_CTYPE2,66 IMAGEMETA_CRVAL1,67 IMAGEMETA_CRVAL2,68 IMAGEMETA_CRPIX1,69 IMAGEMETA_CRPIX2,70 IMAGEMETA_PC001001,71 IMAGEMETA_PC001002,72 IMAGEMETA_PC002001,73 IMAGEMETA_PC002002,74 IMAGEMETA_POLYORDER,75 IMAGEMETA_PCA1X3Y0,76 IMAGEMETA_PCA1X2Y1,77 IMAGEMETA_PCA1X1Y2,78 IMAGEMETA_PCA1X0Y3,79 IMAGEMETA_PCA1X2Y0,80 IMAGEMETA_PCA1X1Y1,81 IMAGEMETA_PCA1X0Y2,82 IMAGEMETA_PCA2X3Y0,83 IMAGEMETA_PCA2X2Y1,84 IMAGEMETA_PCA2X1Y2,85 IMAGEMETA_PCA2X0Y3,86 IMAGEMETA_PCA2X2Y0,87 IMAGEMETA_PCA2X1Y1,88 IMAGEMETA_PCA2X0Y2,89 } ImageMeta;90 5 91 6 typedef enum { … … 95 10 DETECTION_IPPDETECTID, 96 11 DETECTION_FILTERID, 97 DETECTION_XPOS, 98 DETECTION_YPOS, 99 DETECTION_XPOSERR, 100 DETECTION_YPOSERR, 101 DETECTION_IPPRA , 102 DETECTION_IPPDEC , 12 DETECTION_IMAGEID, 13 DETECTION_RA , 14 DETECTION_DEC , 15 DETECTION_INFOFLAG, 103 16 DETECTION_INSTFLUX, 104 DETECTION_INSTFLUXERR,105 DETECTION_PEAKADU,106 DETECTION_PSFWIDMAJOR,107 DETECTION_PSFWIDMINOR,108 DETECTION_PSFTHETA,109 DETECTION_PSFCF,110 DETECTION_INFOFLAG,111 DETECTION_SKY,112 DETECTION_SKYERR,113 17 } Detection; 114 18
Note:
See TracChangeset
for help on using the changeset viewer.
