Changeset 15038
- Timestamp:
- Sep 26, 2007, 5:34:27 PM (19 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 37 edited
-
addstar/src/FilterStars.c (modified) (1 diff)
-
addstar/src/ImageOptions.c (modified) (1 diff)
-
addstar/src/ReadStarsFITS.c (modified) (2 diffs)
-
addstar/src/SEDfit.c (modified) (1 diff)
-
addstar/src/find_matches.c (modified) (6 diffs)
-
addstar/src/find_matches_closest.c (modified) (3 diffs)
-
addstar/src/find_matches_refstars.c (modified) (6 diffs)
-
addstar/src/load2mass_catalog.c (modified) (1 diff)
-
libautocode/def/AddstarClientOptions.d (modified) (2 diffs)
-
libautocode/def/Stars.d (modified) (2 diffs)
-
libautocode/def/autocode.c (modified) (2 diffs)
-
libautocode/def/image-ps1-dev-1.d (modified) (1 diff)
-
libautocode/def/image.d (modified) (1 diff)
-
libautocode/def/measure-ps1-dev-1.d (modified) (3 diffs)
-
libautocode/def/measure.d (modified) (3 diffs)
-
libautocode/def/ps1_dev_1.d (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_elixir.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_loneos.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (6 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (6 diffs)
-
libfits/include/gfitsio.h (modified) (1 diff)
-
libfits/table/F_table_format.c (modified) (1 diff)
-
opihi/dvo/dbExtractMeasures.c (modified) (1 diff)
-
opihi/dvo/gstar.c (modified) (1 diff)
-
opihi/dvo/photometry.c (modified) (5 diffs)
-
opihi/dvo/pmeasure.c (modified) (1 diff)
-
relastro/src/UpdateImages.c (modified) (1 diff)
-
relastro/src/UpdateObjects.c (modified) (2 diffs)
-
relphot/src/GridOps.c (modified) (2 diffs)
-
relphot/src/ImageOps.c (modified) (1 diff)
-
relphot/src/MosaicOps.c (modified) (2 diffs)
-
relphot/src/StarOps.c (modified) (6 diffs)
-
relphot/src/bcatalog.c (modified) (1 diff)
-
relphot/src/plot_scatter.c (modified) (1 diff)
-
relphot/src/setExclusions.c (modified) (1 diff)
-
relphot/src/setMrelFinal.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/FilterStars.c
r12732 r15038 43 43 stars[N].Mcal = image[0].Mcal; 44 44 stars[N].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 45 stars[N].dt = MTIME; 45 46 46 47 stars[N].M = MIN (stars[N].M + MTIME, NO_MAG); -
trunk/Ohana/src/addstar/src/ImageOptions.c
r12332 r15038 36 36 } 37 37 options[0].photcode = equivPhotcode; 38 39 options[0].imageID = 0; 38 40 return (TRUE); 39 41 } -
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r15036 r15038 176 176 stars[i].extNsigma = ps1data[i].extNsigma; 177 177 178 stars[i].detID = ps1data[i].detID; 178 stars[i].detID = ps1data[i].detID; 179 stars[i].flags = ps1data[i].flags; 180 181 // XXX not defined anyway 182 // stars[i].stargal = ps1data[i].stargal; 179 183 180 184 /* these are set elsewhere */ … … 196 200 stars[i].dt = 0; 197 201 stars[i].airmass = 0; 202 stars[i].az = 0; 198 203 stars[i].code = 0; 199 204 stars[i].found = 0; -
trunk/Ohana/src/addstar/src/SEDfit.c
r12332 r15038 186 186 outcat[0].measure[Nmeas].dM = 0.0; 187 187 outcat[0].measure[Nmeas].Mcal = 0; 188 outcat[0].measure[Nmeas].t = TIMEREF;189 outcat[0].measure[Nmeas].averef = Nave;190 outcat[0].measure[Nmeas].photcode = table[0].code[n];191 outcat[0].measure[Nmeas].dophot = 0;192 outcat[0].measure[Nmeas]. flags= 0;188 outcat[0].measure[Nmeas].t = TIMEREF; 189 outcat[0].measure[Nmeas].averef = Nave; 190 outcat[0].measure[Nmeas].photcode = table[0].code[n]; 191 outcat[0].measure[Nmeas].dophot = 0; 192 outcat[0].measure[Nmeas].dbFlags = 0; 193 193 outcat[0].measure[Nmeas].dt = 0xffff; 194 194 -
trunk/Ohana/src/addstar/src/find_matches.c
r14291 r15038 163 163 catalog[0].measure[Nmeas].dD = 3600.0*(catalog[0].average[n].D - stars[N].D); 164 164 165 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */166 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */167 165 catalog[0].measure[Nmeas].Xccd = stars[N].X; 168 166 catalog[0].measure[Nmeas].Yccd = stars[N].Y; … … 175 173 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 176 174 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 177 catalog[0].measure[Nmeas]. flags= 0;175 catalog[0].measure[Nmeas].dbFlags = 0; 178 176 catalog[0].measure[Nmeas].dt = stars[N].dt; 179 177 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 178 179 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 180 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 181 catalog[0].measure[Nmeas].psfProb = stars[N].psfProb; 182 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 183 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 184 catalog[0].measure[Nmeas].Sky = stars[N].sky; 185 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 186 187 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 188 189 catalog[0].measure[Nmeas].detID = stars[N].detID; 190 catalog[0].measure[Nmeas].imageID = options.imageID; 191 192 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 193 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 180 194 181 195 catalog[0].measure[Nmeas].Mgal = stars[N].Mgal; … … 201 215 /* this image star matches more than one catalog star */ 202 216 if (stars[N].found > -1) { 203 catalog[0].measure[stars[N].found]. flags |= BLEND_IMAGE;204 catalog[0].measure[Nmeas]. flags |= BLEND_IMAGE;217 catalog[0].measure[stars[N].found].dbFlags |= BLEND_IMAGE; 218 catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE; 205 219 } 206 220 if (stars[N].found == -2) { /* this image star matches a catalog star on a neighboring catalog */ 207 catalog[0].measure[Nmeas]. flags |= BLEND_IMAGE_NEIGHBOR;221 catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE_NEIGHBOR; 208 222 } 209 223 if (stars[N].found == -1) { /* this image star matches only this catalog star */ … … 212 226 /* this catalog star matches more than one image star */ 213 227 if (catalog[0].found[n] > -1) { 214 catalog[0].measure[catalog[0].found[n]]. flags |= BLEND_CATALOG;215 catalog[0].measure[Nmeas]. flags |= BLEND_CATALOG;228 catalog[0].measure[catalog[0].found[n]].dbFlags |= BLEND_CATALOG; 229 catalog[0].measure[Nmeas].dbFlags |= BLEND_CATALOG; 216 230 } else { 217 231 catalog[0].found[n] = Nmeas; … … 273 287 } 274 288 275 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */276 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */277 289 catalog[0].measure[Nmeas].Xccd = stars[N].X; 278 290 catalog[0].measure[Nmeas].Yccd = stars[N].Y; … … 287 299 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 288 300 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 289 catalog[0].measure[Nmeas]. flags= 0;301 catalog[0].measure[Nmeas].dbFlags = 0; 290 302 catalog[0].measure[Nmeas].dt = stars[N].dt; 291 303 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 304 305 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 306 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 307 catalog[0].measure[Nmeas].psfProb = stars[N].psfProb; 308 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 309 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 310 catalog[0].measure[Nmeas].Sky = stars[N].sky; 311 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 312 313 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 314 315 catalog[0].measure[Nmeas].detID = stars[N].detID; 316 catalog[0].measure[Nmeas].imageID = options.imageID; 317 318 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 319 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 292 320 293 321 catalog[0].measure[Nmeas].Mgal = stars[N].Mgal; -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r14291 r15038 193 193 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 194 194 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 195 catalog[0].measure[Nmeas]. flags= 0;195 catalog[0].measure[Nmeas].dbFlags = 0; 196 196 catalog[0].measure[Nmeas].dt = stars[N].dt; 197 197 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 198 199 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 200 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 201 catalog[0].measure[Nmeas].psfProb = stars[N].psfProb; 202 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 203 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 204 catalog[0].measure[Nmeas].Sky = stars[N].sky; 205 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 206 207 catalog[0].measure[Nmeas].stargal = 0; 208 209 catalog[0].measure[Nmeas].detID = stars[N].detID; 210 catalog[0].measure[Nmeas].imageID = options.imageID; 211 212 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 213 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 198 214 199 215 catalog[0].measure[Nmeas].Mgal = stars[N].Mgal; … … 270 286 } 271 287 272 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */273 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */274 288 catalog[0].measure[Nmeas].Xccd = stars[N].X; 275 289 catalog[0].measure[Nmeas].Yccd = stars[N].Y; … … 284 298 catalog[0].measure[Nmeas].photcode = stars[N].code; /* photcode */ 285 299 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 286 catalog[0].measure[Nmeas]. flags= 0;300 catalog[0].measure[Nmeas].dbFlags = 0; 287 301 catalog[0].measure[Nmeas].dt = stars[N].dt; 288 302 catalog[0].measure[Nmeas].airmass = stars[N].airmass; 303 304 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 305 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 306 catalog[0].measure[Nmeas].psfProb = stars[N].psfProb; 307 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 308 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; 309 catalog[0].measure[Nmeas].Sky = stars[N].sky; 310 catalog[0].measure[Nmeas].dSky = stars[N].dsky; 311 312 catalog[0].measure[Nmeas].stargal = 0; 313 314 catalog[0].measure[Nmeas].detID = stars[N].detID; 315 catalog[0].measure[Nmeas].imageID = options.imageID; 316 317 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 318 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 289 319 290 320 catalog[0].measure[Nmeas].Mgal = stars[N].Mgal; -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r12332 r15038 140 140 catalog[0].measure[Nmeas].photcode = stars[N][0].code; 141 141 catalog[0].measure[Nmeas].dophot = 0; 142 catalog[0].measure[Nmeas]. flags= 0;142 catalog[0].measure[Nmeas].dbFlags = 0; 143 143 catalog[0].measure[Nmeas].dt = 0xffff; 144 144 … … 149 149 catalog[0].measure[Nmeas].theta = NO_MAG; 150 150 151 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */ 152 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */ 151 catalog[0].measure[Nmeas].photFlags = 0; 152 catalog[0].measure[Nmeas].qPSF = 0; 153 catalog[0].measure[Nmeas].psfProb = 0; 154 catalog[0].measure[Nmeas].crNsigma = 0; 155 catalog[0].measure[Nmeas].extNsigma = 0; 156 catalog[0].measure[Nmeas].Sky = 0; 157 catalog[0].measure[Nmeas].dSky = 0; 158 159 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 160 161 catalog[0].measure[Nmeas].detID = 0; 162 catalog[0].measure[Nmeas].imageID = 0; 163 164 catalog[0].measure[Nmeas].dXccd = 0; 165 catalog[0].measure[Nmeas].dYccd = 0; 166 153 167 catalog[0].measure[Nmeas].Xccd = 0.0; 154 168 catalog[0].measure[Nmeas].Yccd = 0.0; … … 168 182 /* this image star matches more than one catalog star */ 169 183 if (stars[N][0].found > -1) { 170 catalog[0].measure[stars[N][0].found]. flags |= BLEND_IMAGE;171 catalog[0].measure[Nmeas]. flags |= BLEND_IMAGE;184 catalog[0].measure[stars[N][0].found].dbFlags |= BLEND_IMAGE; 185 catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE; 172 186 } 173 187 if (stars[N][0].found == -2) { /* this image star matches a catalog star on a neighboring catalog */ 174 catalog[0].measure[Nmeas]. flags |= BLEND_IMAGE_NEIGHBOR;188 catalog[0].measure[Nmeas].dbFlags |= BLEND_IMAGE_NEIGHBOR; 175 189 } 176 190 if (stars[N][0].found == -1) { /* this image star matches only this catalog star */ … … 179 193 /* this catalog star matches more than one image star */ 180 194 if (catalog[0].found[n] > -1) { 181 catalog[0].measure[catalog[0].found[n]]. flags |= BLEND_CATALOG;182 catalog[0].measure[Nmeas]. flags |= BLEND_CATALOG;195 catalog[0].measure[catalog[0].found[n]].dbFlags |= BLEND_CATALOG; 196 catalog[0].measure[Nmeas].dbFlags |= BLEND_CATALOG; 183 197 } else { 184 198 catalog[0].found[n] = Nmeas; … … 254 268 catalog[0].measure[Nmeas].photcode = stars[N][0].code; 255 269 catalog[0].measure[Nmeas].dophot = 0; 256 catalog[0].measure[Nmeas]. flags= 0;270 catalog[0].measure[Nmeas].dbFlags = 0; 257 271 catalog[0].measure[Nmeas].dt = 0xffff; 272 273 catalog[0].measure[Nmeas].photFlags = 0; 274 catalog[0].measure[Nmeas].qPSF = 0; 275 catalog[0].measure[Nmeas].psfProb = 0; 276 catalog[0].measure[Nmeas].crNsigma = 0; 277 catalog[0].measure[Nmeas].extNsigma = 0; 278 catalog[0].measure[Nmeas].Sky = 0; 279 catalog[0].measure[Nmeas].dSky = 0; 280 281 catalog[0].measure[Nmeas].stargal = 0; // XXX not yet set 282 283 catalog[0].measure[Nmeas].detID = 0; 284 catalog[0].measure[Nmeas].imageID = 0; 285 286 catalog[0].measure[Nmeas].dXccd = 0; 287 catalog[0].measure[Nmeas].dYccd = 0; 288 289 catalog[0].measure[Nmeas].Xccd = 0.0; 290 catalog[0].measure[Nmeas].Yccd = 0.0; 258 291 259 292 catalog[0].measure[Nmeas].airmass = 0; … … 263 296 catalog[0].measure[Nmeas].theta = NO_MAG; 264 297 265 /* XXX need to add dX, dY : need to load into stars[N].dX,dY */266 /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */267 298 catalog[0].measure[Nmeas].Xccd = 0.0; 268 299 catalog[0].measure[Nmeas].Yccd = 0.0; -
trunk/Ohana/src/addstar/src/load2mass_catalog.c
r12332 r15038 52 52 catalog[0].measure[Nmeas].dM = MIN (stars[i+j].dM, NO_ERR); 53 53 catalog[0].measure[Nmeas].Mcal = 0; 54 catalog[0].measure[Nmeas].t = stars[i+j].t;55 catalog[0].measure[Nmeas].averef = Nave;56 catalog[0].measure[Nmeas].photcode = stars[i+j].code;57 catalog[0].measure[Nmeas].dophot = 0;58 catalog[0].measure[Nmeas]. flags= 0;54 catalog[0].measure[Nmeas].t = stars[i+j].t; 55 catalog[0].measure[Nmeas].averef = Nave; 56 catalog[0].measure[Nmeas].photcode = stars[i+j].code; 57 catalog[0].measure[Nmeas].dophot = 0; 58 catalog[0].measure[Nmeas].dbFlags = 0; 59 59 catalog[0].measure[Nmeas].dt = 0xffff; 60 60 -
trunk/Ohana/src/libautocode/def/AddstarClientOptions.d
r5345 r15038 2 2 EXTNAME OPTIONS 3 3 TYPE BINTABLE 4 SIZE 7 24 SIZE 76 5 5 6 6 FIELD Nsigma, NSIGMA, double, match radius in terms of astrometric error … … 20 20 FIELD photcode, PHOTCODE, int, photocode of input data 21 21 FIELD timeref, TIMEREF, e_time, time/date of input data (REFLIST only?) 22 FIELD imageID, IMAGE_ID, unsigned int, reference to image -
trunk/Ohana/src/libautocode/def/Stars.d
r15034 r15038 2 2 EXTNAME STARS 3 3 TYPE BINTABLE 4 SIZE 24 04 SIZE 244 5 5 6 6 FIELD X, X, double, x coordinate on image, pixels … … 38 38 FIELD Mcal, MCAL, float, image cal mag, mag 39 39 FIELD airmass, AIRMASS, float, (airmass - 1), airmass 40 FIELD az, AZ, float, azimuth 40 41 FIELD code, CODE, short 41 42 FIELD nFrames, N_FRAMES, short 43 FIELD flags, FLAGS, short 42 44 FIELD dophot, DOPHOT, char, dophot type code 43 FIELD dummy, DUMMY, char [3]45 FIELD dummy, DUMMY, char 44 46 45 47 # XXX I'm going to need azimuth (or load from image header?) -
trunk/Ohana/src/libautocode/def/autocode.c
r7080 r15038 36 36 if ((swapped == NULL) || (*swapped == FALSE)) { 37 37 gfits_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata); 38 gfits_table_scale_data (ftable); 38 39 if (swapped != NULL) *swapped = TRUE; 39 40 } … … 57 58 58 59 /* add data values */ 60 gfits_table_scale_data (ftable); 59 61 gfits_convert_$STRUCT (data, sizeof ($STRUCT), Ndata); 60 62 gfits_add_rows (ftable, (char *) data, Ndata, sizeof ($STRUCT)); -
trunk/Ohana/src/libautocode/def/image-ps1-dev-1.d
r15034 r15038 48 48 FIELD code, CODE, char, image quality flag 49 49 FIELD ccdnum, CCDNUM, unsigned char, CCD ID number 50 FIELD imageID_hi, IMAGE_ID_HI, unsigned int, ID upper bytes 51 FIELD imageID_lo, IMAGE_ID_LO, unsigned int, ID lower bytes 52 # 48 bytes 50 FIELD imageID, IMAGE_ID, unsigned int, image ID 51 # 44 bytes 53 52 54 FIELD dummy, DUMMY, char[1 0], unused53 FIELD dummy, DUMMY, char[14], unused 55 54 FIELD order, ORDER, short, Mrel 2D polynomical order 56 55 FIELD Mx, MX, short, Mrel polyterm -
trunk/Ohana/src/libautocode/def/image.d
r13884 r15038 48 48 FIELD code, CODE, char, image quality flag 49 49 FIELD ccdnum, CCDNUM, unsigned char, CCD ID number 50 FIELD imageID_hi, IMAGE_ID_HI, unsigned int, ID upper bytes 51 FIELD imageID_lo, IMAGE_ID_LO, unsigned int, ID lower bytes 50 FIELD imageID, IMAGE_ID, unsigned int, image ID 52 51 # 48 bytes 53 52 54 FIELD dummy, DUMMY, char[1 0], unused53 FIELD dummy, DUMMY, char[14], unused 55 54 FIELD order, ORDER, short, Mrel 2D polynomical order 56 55 FIELD Mx, MX, short, Mrel polyterm -
trunk/Ohana/src/libautocode/def/measure-ps1-dev-1.d
r15034 r15038 2 2 EXTNAME DVO_MEASURE_PS1_DEV_1 3 3 TYPE BINTABLE 4 SIZE 964 SIZE 104 5 5 DESCRIPTION DVO Detection Measurement Table 6 6 … … 8 8 FIELD dD, D_DEC, float, DEC offset, arcsec 9 9 FIELD M, MAG, float, catalog mag, mag 10 FIELD Mcal, M cal,float, image cal mag, mag11 FIELD Mgal, M gal,float, galaxy mag, mag12 FIELD dM, dM,float, mag error, mag13 FIELD dt, dt,float, exposure time, 2.5*log(exptime)10 FIELD Mcal, M_CAL, float, image cal mag, mag 11 FIELD Mgal, M_GAL, float, galaxy mag, mag 12 FIELD dM, MAG_ERR, float, mag error, mag 13 FIELD dt, M_TIME, float, exposure time, 2.5*log(exptime) 14 14 15 15 # note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation 16 FIELD airmass, airmass, float, (airmass - 1), airmass16 FIELD airmass, AIRMASS, float, (airmass - 1), airmass 17 17 FIELD az, AZ, float, telescope azimuth 18 18 … … 25 25 FIELD dSky, SKY_FLUX_ERR, float, local estimate of sky flux, counts/sec 26 26 27 FIELD t, t,unsigned int, time in seconds (UNIX)28 FIELD averef, averef,unsigned int, reference to average entry27 FIELD t, TIME, unsigned int, time in seconds (UNIX) 28 FIELD averef, AVE_REF, unsigned int, reference to average entry 29 29 30 30 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints for backwards compatibility? 31 FIELD detID _hi, DET_ID_HI,unsigned int, ID upper bytes32 FIELD detID_lo, DET_ID_LO, unsigned int, ID lower bytes31 FIELD detID, DET_ID, unsigned int, ID upper bytes 32 FIELD imageID, IMAGE_ID, unsigned int, reference to image 33 33 34 FIELD imageID_hi, IMAGE_ID_HI, unsigned int, reference to image 35 FIELD imageID_lo, IMAGE_ID_LO, unsigned int, reference to image 34 # do we need more resolution than a short? should this be a log? 35 FIELD qPSF, PSF_QF, float, psf coverage/quality factor 36 FIELD psfProb, PSF_PROB, float, psf coverage/quality factor 37 FIELD crNsigma, CR_NSIGMA, float, psf coverage/quality factor 38 FIELD extNsigma, EXT_NSIGMA, float, psf coverage/quality factor 36 39 37 FIELD FWx, FWx, short, object fwhm major axis, 1/100 of arcsec 38 FIELD FWy, FWy, short, object fwhm minor axis, 1/100 of arcsec 39 FIELD theta, theta, short, angle wrt ccd X dir, (0xffff/360) deg 40 FIELD photcode, photcode, unsigned short, photcode 41 42 FIELD flags, flags, unsigned short, flags for various uses 40 FIELD FWx, FWHM_MAJOR, short, object fwhm major axis, 1/100 of arcsec 41 FIELD FWy, FWHM_MINOR, short, object fwhm minor axis, 1/100 of arcsec 42 FIELD theta, PSF_THETA, short, angle wrt ccd X dir, (0xffff/360) deg 43 FIELD photcode, PHOTCODE, unsigned short, photcode 43 44 44 45 FIELD dXccd, X_CCD_ERR, short, X coord error on chip, pixels 45 46 FIELD dYccd, Y_CCD_ERR, short, Y coord error on chip, pixels 46 47 47 # do we need more resolution than a short? should this be a log? 48 FIELD qPSF, PSF_QF, short, psf coverage/quality factor48 FIELD dbFlags, DB_FLAGS, unsigned short, flags for various uses 49 FIELD photFlags, PHOT_FLAGS, unsigned short, flags supplied by photometry program 49 50 50 FIELD dophot, dophot, char, dophot type 51 FIELD stargal, stargal, char, star-galaxy separator 51 FIELD stargal, STAR_GAL, char, star-galaxy separator 52 52 53 # we need extra bytes for padding purposes...54 FIELD d ummy, dummy, char[2], padding53 # absorb these into photFlags? 54 FIELD dophot, DOPHOT, char, dophot type 55 55 56 # float : 13 x 4 = 52 56 FIELD dummy, DUMMY, char[2], padding 57 58 # float : 17 x 4 = 68 57 59 # int: 6 x 4 = 24 58 60 # short: 8 x 2 = 16 -
trunk/Ohana/src/libautocode/def/measure.d
r12332 r15038 2 2 EXTNAME DVO_MEASURE 3 3 TYPE BINTABLE 4 SIZE 964 SIZE 104 5 5 DESCRIPTION DVO Detection Measurement Table 6 6 … … 11 11 FIELD Mgal, Mgal, float, galaxy mag, mag 12 12 FIELD dM, dM, float, mag error, mag 13 FIELD airmass, airmass, float, (airmass - 1), airmass14 13 FIELD dt, dt, float, exposure time, 2.5*log(exptime) 15 14 16 FIELD t, t, unsigned int, time in seconds (UNIX) 17 FIELD averef, averef, unsigned int, reference to average entry 18 19 FIELD FWx, FWx, short, object fwhm major axis, 1/100 of arcsec 20 FIELD FWy, FWy, short, object fwhm minor axis, 1/100 of arcsec 21 FIELD theta, theta, short, angle wrt ccd X dir, (0xffff/360) deg 22 FIELD photcode, photcode, unsigned short, photcode 23 24 FIELD flags, flags, unsigned short, flags for various uses 25 FIELD dophot, dophot, char, dophot type 26 FIELD stargal, stargal, char, star-galaxy separator 15 # note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation 16 FIELD airmass, airmass, float, (airmass - 1), airmass 17 FIELD az, AZ, float, telescope azimuth 27 18 28 19 # new field elements needed for Pan-STARRS: … … 34 25 FIELD dSky, SKY_FLUX_ERR, float, local estimate of sky flux, counts/sec 35 26 27 FIELD t, t, unsigned int, time in seconds (UNIX) 28 FIELD averef, averef, unsigned int, reference to average entry 29 30 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints for backwards compatibility? 31 FIELD detID, DET_ID, unsigned int, detection ID 32 FIELD imageID, IMAGE_ID, unsigned int, reference to image 33 34 # do we need more resolution than a short? should this be a log? 35 FIELD qPSF, PSF_QF, float, psf coverage/quality factor 36 FIELD psfProb, PSF_PROB, float, psf coverage/quality factor 37 FIELD crNsigma, CR_NSIGMA, float, psf coverage/quality factor 38 FIELD extNsigma, EXT_NSIGMA, float, psf coverage/quality factor 39 40 FIELD FWx, FWx, short, object fwhm major axis, 1/100 of arcsec 41 FIELD FWy, FWy, short, object fwhm minor axis, 1/100 of arcsec 42 FIELD theta, theta, short, angle wrt ccd X dir, (0xffff/360) deg 43 FIELD photcode, photcode, unsigned short, photcode 44 36 45 FIELD dXccd, X_CCD_ERR, short, X coord error on chip, pixels 37 46 FIELD dYccd, Y_CCD_ERR, short, Y coord error on chip, pixels 38 47 39 # do we need more resolution than a short? should this be a log? 40 FIELD qPSF, PSF_QF, short, psf coverage/quality factor48 FIELD dbFlags, DB_FLAGS, unsigned short, flags for various uses 49 FIELD photFlags, PHOT_FLAGS, unsigned short, flags supplied by photometry program 41 50 42 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints for backwards compatibility? 43 FIELD detID_hi, DET_ID_HI, unsigned int, ID upper bytes 44 FIELD detID_lo, DET_ID_LO, unsigned int, ID lower bytes 51 FIELD stargal, stargal, char, star-galaxy separator 45 52 46 FIELD imageID_hi, IMAGE_ID_HI, unsigned int, reference to image 47 FIELD imageID_lo, IMAGE_ID_LO, unsigned int, reference to image53 # absorb these into photFlags? 54 FIELD dophot, dophot, char, dophot type 48 55 49 # note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation 50 FIELD az, AZ, float, telescope azimuth 51 52 # we need extra bytes for padding purposes... 53 FIELD dummy, dummy, char[2], padding 56 FIELD dummy, DUMMY, char[2], padding -
trunk/Ohana/src/libautocode/def/ps1_dev_1.d
r15034 r15038 24 24 FIELD psfQual, PSF_QF, float, quality factor 25 25 FIELD nFrames, N_FRAMES, short, images overlapping peak 26 FIELD dummy, DUMMY, short, padding26 FIELD flags, FLAGS, short, padding -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r15035 r15038 15 15 out[i].dD = in[i].dD; 16 16 out[i].M = in[i].M; 17 out[i].dM = in[i].dM;18 17 out[i].Mcal = in[i].Mcal; 19 18 out[i].Mgal = in[i].Mgal; 19 out[i].dM = in[i].dM; 20 out[i].dt = in[i].dt; 20 21 out[i].airmass = in[i].airmass; 21 22 out[i].az = in[i].az; 22 out[i].dt = in[i].dt; 23 out[i].Xccd = in[i].Xccd; 24 out[i].Yccd = in[i].Yccd; 25 out[i].Sky = in[i].Sky; 26 out[i].dSky = in[i].dSky; 27 out[i].t = in[i].t; 28 out[i].averef = in[i].averef; 29 out[i].detID = in[i].detID; 30 out[i].imageID = in[i].imageID; 31 out[i].qPSF = in[i].qPSF; 32 out[i].psfProb = in[i].psfProb; 33 out[i].crNsigma = in[i].crNsigma; 34 out[i].extNsigma = in[i].extNsigma; 23 35 out[i].FWx = in[i].FWx; 24 36 out[i].FWy = in[i].FWy; 25 37 out[i].theta = in[i].theta; 26 out[i].dophot = in[i].dophot;27 38 out[i].photcode = in[i].photcode; 28 out[i].t = in[i].t;29 out[i].averef = in[i].averef;30 out[i].flags = in[i].flags;31 out[i].Xccd = in[i].Xccd;32 out[i].Yccd = in[i].Yccd;33 39 out[i].dXccd = in[i].dXccd; 34 40 out[i].dYccd = in[i].dYccd; 41 out[i].dbFlags = in[i].dbFlags; 42 out[i].photFlags = in[i].photFlags; 35 43 out[i].stargal = in[i].stargal; 36 out[i].Sky = in[i].Sky; 37 out[i].dSky = in[i].dSky; 38 out[i].qPSF = in[i].qPSF; 39 out[i].detID_hi = in[i].detID_hi; 40 out[i].detID_lo = in[i].detID_lo; 41 out[i].imageID_hi = in[i].imageID_hi; 42 out[i].imageID_lo = in[i].imageID_lo; 44 out[i].dophot = in[i].dophot; 43 45 } 44 46 return (out); … … 57 59 out[i].dD = in[i].dD; 58 60 out[i].M = in[i].M; 59 out[i].dM = in[i].dM;60 61 out[i].Mcal = in[i].Mcal; 61 62 out[i].Mgal = in[i].Mgal; 63 out[i].dM = in[i].dM; 64 out[i].dt = in[i].dt; 62 65 out[i].airmass = in[i].airmass; 63 66 out[i].az = in[i].az; 64 out[i].dt = in[i].dt; 67 out[i].Xccd = in[i].Xccd; 68 out[i].Yccd = in[i].Yccd; 69 out[i].Sky = in[i].Sky; 70 out[i].dSky = in[i].dSky; 71 out[i].t = in[i].t; 72 out[i].averef = in[i].averef; 73 out[i].detID = in[i].detID; 74 out[i].imageID = in[i].imageID; 75 out[i].qPSF = in[i].qPSF; 76 out[i].psfProb = in[i].psfProb; 77 out[i].crNsigma = in[i].crNsigma; 78 out[i].extNsigma = in[i].extNsigma; 65 79 out[i].FWx = in[i].FWx; 66 80 out[i].FWy = in[i].FWy; 67 81 out[i].theta = in[i].theta; 68 out[i].dophot = in[i].dophot;69 82 out[i].photcode = in[i].photcode; 70 out[i].t = in[i].t;71 out[i].averef = in[i].averef;72 out[i].flags = in[i].flags;73 out[i].Xccd = in[i].Xccd;74 out[i].Yccd = in[i].Yccd;75 83 out[i].dXccd = in[i].dXccd; 76 84 out[i].dYccd = in[i].dYccd; 85 out[i].dbFlags = in[i].dbFlags; 86 out[i].photFlags = in[i].photFlags; 77 87 out[i].stargal = in[i].stargal; 78 out[i].Sky = in[i].Sky; 79 out[i].dSky = in[i].dSky; 80 out[i].qPSF = in[i].qPSF; 81 out[i].detID_hi = in[i].detID_hi; 82 out[i].detID_lo = in[i].detID_lo; 83 out[i].imageID_hi = in[i].imageID_hi; 84 out[i].imageID_lo = in[i].imageID_lo; 88 out[i].dophot = in[i].dophot; 85 89 } 86 90 return (out); … … 221 225 out[i].code = in[i].code; 222 226 out[i].ccdnum = in[i].ccdnum; 223 out[i].imageID_hi = in[i].imageID_hi; 224 out[i].imageID_lo = in[i].imageID_lo; 227 out[i].imageID = in[i].imageID; 225 228 226 229 out[i].order = in[i].order; … … 277 280 out[i].code = in[i].code; 278 281 out[i].ccdnum = in[i].ccdnum; 279 out[i].imageID_hi = in[i].imageID_hi; 280 out[i].imageID_lo = in[i].imageID_lo; 282 out[i].imageID = in[i].imageID; 281 283 282 284 out[i].order = in[i].order; -
trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c
r15035 r15038 25 25 out[i].t = in[i].t; 26 26 out[i].averef = in[i].averef; 27 out[i]. flags= in[i].flags;27 out[i].dbFlags = in[i].flags; 28 28 29 29 /* these can be determined if needed / desired */ … … 34 34 35 35 /* these do not have a corresponding value */ 36 out[i].stargal = 0; 37 out[i].Sky = 0; 38 out[i].dSky = 0; 39 out[i].qPSF = 0; 36 out[i].az = 0; 37 out[i].stargal = 0; 38 out[i].Sky = 0; 39 out[i].dSky = 0; 40 out[i].qPSF = 0; 41 out[i].psfProb = 0; 42 out[i].crNsigma = 0; 43 out[i].extNsigma = 0; 44 out[i].photFlags = 0; 40 45 41 46 /* XXX add these later */ 42 out[i].detID_hi = 0; 43 out[i].detID_lo = 0; 44 out[i].imageID_hi = 0; 45 out[i].imageID_lo = 0; 47 out[i].detID = 0; 48 out[i].imageID = 0; 46 49 } 47 50 return (out); … … 72 75 out[i].t = in[i].t; 73 76 out[i].averef = in[i].averef; 74 out[i].flags = in[i]. flags;77 out[i].flags = in[i].dbFlags; 75 78 } 76 79 return (out); … … 232 235 233 236 /* XXX add these later */ 234 out[i].imageID_hi = 0; 235 out[i].imageID_lo = 0; 237 out[i].imageID = 0; 236 238 } 237 239 return (out); -
trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c
r15035 r15038 10 10 11 11 for (i = 0; i < Nvalues; i++) { 12 out[i].dR = in[i].dR * 0.01;13 out[i].dD = in[i].dD * 0.01;14 out[i].M = in[i].M * 0.001;15 out[i].dM = in[i].dM * 0.001;16 out[i].Mcal = in[i].Mcal * 0.001;17 out[i].dophot = in[i].dophot;12 out[i].dR = in[i].dR * 0.01; 13 out[i].dD = in[i].dD * 0.01; 14 out[i].M = in[i].M * 0.001; 15 out[i].dM = in[i].dM * 0.001; 16 out[i].Mcal = in[i].Mcal * 0.001; 17 out[i].dophot = in[i].dophot; 18 18 out[i].photcode = in[i].source; 19 out[i].t = in[i].t;19 out[i].t = in[i].t; 20 20 21 21 /* flags and averef are now split */ 22 out[i].averef = in[i].averef & 0x00ffffff;23 out[i]. flags = (in[i].averef & 0xff000000) >> 24;22 out[i].averef = in[i].averef & 0x00ffffff; 23 out[i].dbFlags = (in[i].averef & 0xff000000) >> 24; 24 24 25 25 /* these values don't exist in the Loneos format */ 26 out[i].Mgal = in[i].M; 27 out[i].dt = 0; 28 out[i].airmass = 0; 29 out[i].FWx = 0; 30 out[i].FWy = 0; 31 out[i].theta = 0; 26 out[i].Mgal = in[i].M; 27 out[i].dt = 0; 28 out[i].airmass = 0; 29 out[i].az = 0; 30 out[i].FWx = 0; 31 out[i].FWy = 0; 32 out[i].theta = 0; 32 33 out[i].stargal = 0; 33 34 out[i].Sky = 0; 34 35 out[i].dSky = 0; 35 36 out[i].qPSF = 0; 37 out[i].psfProb = 0; 38 out[i].crNsigma = 0; 39 out[i].extNsigma = 0; 40 out[i].photFlags = 0; 36 41 37 42 /* these can be determined if needed / desired */ … … 42 47 43 48 /* XXX add these later */ 44 out[i].detID_hi = 0; 45 out[i].detID_lo = 0; 46 out[i].imageID_hi = 0; 47 out[i].imageID_lo = 0; 49 out[i].detID = 0; 50 out[i].imageID = 0; 48 51 } 49 52 return (out); … … 69 72 70 73 /* flags and averef are merged in Loneos */ 71 out[i].averef = (in[i].averef & 0x00ffffff) | (in[i]. flags << 24);74 out[i].averef = (in[i].averef & 0x00ffffff) | (in[i].dbFlags << 24); 72 75 } 73 76 return (out); … … 226 229 227 230 /* XXX add these later */ 228 out[i].imageID_hi = 0; 229 out[i].imageID_lo = 0; 231 out[i].imageID = 0; 230 232 } 231 233 return (out); -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r15035 r15038 26 26 out[i].t = in[i].t; 27 27 out[i].averef = in[i].averef; 28 out[i]. flags= in[i].flags;28 out[i].dbFlags = in[i].flags; 29 29 out[i].Xccd = in[i].Xccd; 30 30 out[i].Yccd = in[i].Yccd; … … 35 35 out[i].dSky = in[i].dSky; 36 36 out[i].qPSF = in[i].qPSF; 37 out[i].detID_hi = in[i].detID_hi; 38 out[i].detID_lo = in[i].detID_lo; 39 out[i].imageID_hi = in[i].imageID_hi; 40 out[i].imageID_lo = in[i].imageID_lo; 37 out[i].detID = in[i].detID_lo; 38 out[i].imageID = in[i].imageID_lo; 39 40 // these don't have a correspondence 41 out[i].psfProb = 0; 42 out[i].crNsigma = 0; 43 out[i].extNsigma = 0; 44 out[i].photFlags = 0; 41 45 } 42 46 return (out); … … 68 72 out[i].t = in[i].t; 69 73 out[i].averef = in[i].averef; 70 out[i].flags = in[i]. flags;74 out[i].flags = in[i].dbFlags; 71 75 out[i].Xccd = in[i].Xccd; 72 76 out[i].Yccd = in[i].Yccd; … … 77 81 out[i].dSky = in[i].dSky; 78 82 out[i].qPSF = in[i].qPSF; 79 out[i].detID_hi = in[i].detID_hi;80 out[i].detID_lo = in[i].detID _lo;81 out[i].imageID_hi = in[i].imageID_hi;82 out[i].imageID_lo = in[i].imageID _lo;83 out[i].detID_hi = 0; 84 out[i].detID_lo = in[i].detID; 85 out[i].imageID_hi = 0; 86 out[i].imageID_lo = in[i].imageID; 83 87 } 84 88 return (out); … … 219 223 out[i].code = in[i].code; 220 224 out[i].ccdnum = in[i].ccdnum; 221 out[i].imageID_hi = in[i].imageID_hi; 222 out[i].imageID_lo = in[i].imageID_lo; 225 out[i].imageID = in[i].imageID_lo; 223 226 224 227 out[i].order = in[i].order; … … 275 278 out[i].code = in[i].code; 276 279 out[i].ccdnum = in[i].ccdnum; 277 out[i].imageID_hi = in[i].imageID_hi;278 out[i].imageID_lo = in[i].imageID _lo;280 out[i].imageID_hi = 0; 281 out[i].imageID_lo = in[i].imageID; 279 282 280 283 out[i].order = in[i].order; -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r15035 r15038 26 26 out[i].t = in[i].t; 27 27 out[i].averef = in[i].averef; 28 out[i]. flags= in[i].flags;28 out[i].dbFlags = in[i].flags; 29 29 out[i].Xccd = in[i].Xccd; 30 30 out[i].Yccd = in[i].Yccd; … … 35 35 out[i].dSky = in[i].dSky; 36 36 out[i].qPSF = in[i].qPSF; 37 out[i].detID_hi = in[i].detID_hi; 38 out[i].detID_lo = in[i].detID_lo; 39 out[i].imageID_hi = in[i].imageID_hi; 40 out[i].imageID_lo = in[i].imageID_lo; 37 out[i].detID = in[i].detID_lo; 38 out[i].imageID = in[i].imageID_lo; 39 40 // these don't have a correspondence 41 out[i].psfProb = 0; 42 out[i].crNsigma = 0; 43 out[i].extNsigma = 0; 44 out[i].photFlags = 0; 41 45 } 42 46 return (out); … … 68 72 out[i].t = in[i].t; 69 73 out[i].averef = in[i].averef; 70 out[i].flags = in[i]. flags;74 out[i].flags = in[i].dbFlags; 71 75 out[i].Xccd = in[i].Xccd; 72 76 out[i].Yccd = in[i].Yccd; … … 77 81 out[i].dSky = in[i].dSky; 78 82 out[i].qPSF = in[i].qPSF; 79 out[i].detID_hi = in[i].detID_hi;80 out[i].detID_lo = in[i].detID _lo;81 out[i].imageID_hi = in[i].imageID_hi;82 out[i].imageID_lo = in[i].imageID _lo;83 out[i].detID_hi = 0; 84 out[i].detID_lo = in[i].detID; 85 out[i].imageID_hi = 0; 86 out[i].imageID_lo = in[i].imageID; 83 87 } 84 88 return (out); … … 219 223 out[i].code = in[i].code; 220 224 out[i].ccdnum = in[i].ccdnum; 221 out[i].imageID_hi = in[i].imageID_hi; 222 out[i].imageID_lo = in[i].imageID_lo; 225 out[i].imageID = in[i].imageID_lo; 223 226 224 227 out[i].order = in[i].order; … … 275 278 out[i].code = in[i].code; 276 279 out[i].ccdnum = in[i].ccdnum; 277 out[i].imageID_hi = in[i].imageID_hi;278 out[i].imageID_lo = in[i].imageID _lo;280 out[i].imageID_hi = 0; 281 out[i].imageID_lo = in[i].imageID; 279 282 280 283 out[i].order = in[i].order; -
trunk/Ohana/src/libfits/include/gfitsio.h
r15007 r15038 126 126 int gfits_add_rows PROTO ((FTable *, char *, int, int)); 127 127 char *gfits_table_print PROTO ((FTable *,...)); 128 int gfits_table_scale_data PROTO ((FTable *ftable)); 129 int gfits_table_scale_storage PROTO ((FTable *ftable)); 128 130 129 131 /******************************* Matrix functions *************/ -
trunk/Ohana/src/libfits/table/F_table_format.c
r7054 r15038 189 189 } 190 190 191 /* vsnprintf (&line[off], Nchar + 1, format, argp); */ 191 // apply table tzero, tscal in situ (from storage to data) 192 int gfits_table_scale_data (FTable *ftable) { 193 194 int i, j, n, Nx, Ny, Nfields; 195 int off, Nchar, Nval, Nbytes, status; 196 char *line, format[64], field[16], type[16]; 197 double tzero, tscale; 198 char *tmpChar; 199 short *tmpShort; 200 int *tmpInt; 201 202 off = 0; 203 204 gfits_scan (ftable[0].header, "NAXIS1", "%d", 1, &Nx); 205 gfits_scan (ftable[0].header, "NAXIS2", "%d", 1, &Ny); 206 gfits_scan (ftable[0].header, "TFIELDS", "%d", 1, &Nfields); 207 208 for (i = 1; i <= Nfields; i++) { 209 sprintf (field, "TFORM%d", i); 210 gfits_scan (ftable[0].header, field, "%s", 1, format); /* get field format */ 211 gfits_bintable_format (format, type, &Nval, &Nbytes); /* convert to c-style */ 212 Nchar = Nval * Nbytes; 213 214 sprintf (field, "TZERO%d", i); 215 status = gfits_scan (ftable[0].header, field, "%lf", 1, &tzero); /* get field format */ 216 if (!status) { 217 off += Nchar; 218 continue; 219 } 220 221 sprintf (field, "TSCAL%d", i); 222 status = gfits_scan (ftable[0].header, field, "%lf", 1, &tscale); /* get field format */ 223 if (!status) { 224 off += Nchar; 225 continue; 226 } 227 if (tscale == 0.0) { 228 off += Nchar; 229 continue; 230 } 231 232 if (!strcmp (type, "char")) { 233 for (j = 0; j < Ny; j++) { 234 for (n = 0; n < Nval; n++) { 235 tmpChar = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 236 *tmpChar = *tmpChar * tscale + tzero; 237 } 238 } 239 } 240 if (!strcmp (type, "short")) { 241 for (j = 0; j < Ny; j++) { 242 for (n = 0; n < Nval; n++) { 243 tmpShort = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 244 *tmpShort = *tmpShort * tscale + tzero; 245 } 246 } 247 } 248 if (!strcmp (type, "int")) { 249 for (j = 0; j < Ny; j++) { 250 for (n = 0; n < Nval; n++) { 251 tmpInt = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 252 *tmpInt = *tmpInt * tscale + tzero; 253 } 254 } 255 } 256 off += Nchar; 257 } 258 return (TRUE); 259 } 260 261 // apply table tzero, tscal in situ (from data to storage) 262 int gfits_table_scale_storage (FTable *ftable) { 263 264 int i, j, n, Nx, Ny, Nfields; 265 int off, Nchar, Nval, Nbytes, status; 266 char *line, format[64], field[16], type[16]; 267 double tzero, tscale; 268 char *tmpChar; 269 short *tmpShort; 270 int *tmpInt; 271 272 off = 0; 273 274 gfits_scan (ftable[0].header, "NAXIS1", "%d", 1, &Nx); 275 gfits_scan (ftable[0].header, "NAXIS2", "%d", 1, &Ny); 276 gfits_scan (ftable[0].header, "TFIELDS", "%d", 1, &Nfields); 277 278 for (i = 1; i <= Nfields; i++) { 279 sprintf (field, "TFORM%d", i); 280 gfits_scan (ftable[0].header, field, "%s", 1, format); /* get field format */ 281 gfits_bintable_format (format, type, &Nval, &Nbytes); /* convert to c-style */ 282 Nchar = Nval * Nbytes; 283 284 sprintf (field, "TZERO%d", i); 285 status = gfits_scan (ftable[0].header, field, "%lf", 1, &tzero); /* get field format */ 286 if (!status) { 287 off += Nchar; 288 continue; 289 } 290 291 sprintf (field, "TSCAL%d", i); 292 status = gfits_scan (ftable[0].header, field, "%lf", 1, &tscale); /* get field format */ 293 if (!status) { 294 off += Nchar; 295 continue; 296 } 297 if (tscale == 0.0) { 298 off += Nchar; 299 continue; 300 } 301 302 if (!strcmp (type, "char")) { 303 for (j = 0; j < Ny; j++) { 304 for (n = 0; n < Nval; n++) { 305 tmpChar = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 306 *tmpChar = (*tmpChar - tzero) / tscale; 307 } 308 } 309 } 310 if (!strcmp (type, "short")) { 311 for (j = 0; j < Ny; j++) { 312 for (n = 0; n < Nval; n++) { 313 tmpShort = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 314 *tmpShort = (*tmpShort - tzero) / tscale; 315 } 316 } 317 } 318 if (!strcmp (type, "int")) { 319 for (j = 0; j < Ny; j++) { 320 for (n = 0; n < Nval; n++) { 321 tmpInt = (int *)&ftable[0].buffer[j*Nx + n*Nbytes + off]; 322 *tmpInt = (*tmpInt - tzero) / tscale; 323 } 324 } 325 } 326 off += Nchar; 327 } 328 return (TRUE); 329 } -
trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c
r14590 r15038 161 161 // break; 162 162 case MEAS_FLAGS: /* ? */ 163 value = measure[0]. flags;163 value = measure[0].dbFlags; 164 164 break; 165 165 case MEAS_XCCD: /* OK */ -
trunk/Ohana/src/opihi/dvo/gstar.c
r14590 r15038 172 172 Mcat, Mrel, catalog.measure[m].dM, 173 173 date, catalog.measure[m].dR, catalog.measure[m].dD, 174 catalog.measure[m].dophot, catalog.measure[m]. flags,174 catalog.measure[m].dophot, catalog.measure[m].dbFlags, 175 175 catalog.measure[m].photcode, GetPhotcodeNamebyCode (catalog.measure[m].photcode)); 176 176 free (date); -
trunk/Ohana/src/opihi/dvo/photometry.c
r14590 r15038 24 24 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \ 25 25 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ 26 if (FlagSelect && (M. flags != FlagValue)) continue; \26 if (FlagSelect && (M.dbFlags != FlagValue)) continue; \ 27 27 } 28 28 … … 688 688 for (i = 0; i < average[0].Nm; i++) { 689 689 if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue; 690 if (measure[i]. flags & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;690 if (measure[i].dbFlags & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue; 691 691 value ++; 692 692 } … … 698 698 if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode))) continue; 699 699 if (ErrSelect && (measure[i].dM > ErrValue)) continue; 700 if (FlagSelect && (measure[i]. flags != FlagValue)) continue;700 if (FlagSelect && (measure[i].dbFlags != FlagValue)) continue; 701 701 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&measure[i]))) continue; 702 702 if (iMagSelect && (PhotInst (&measure[i]) < iMagMin)) continue; … … 874 874 for (i = 0; i < average[0].Nm; i++) { 875 875 TESTCODE (code, measure[i]); 876 if (measure[i]. flags && ID_MEAS_SKIP) continue;876 if (measure[i].dbFlags && ID_MEAS_SKIP) continue; 877 877 Nm++; 878 878 } … … 1169 1169 break; 1170 1170 case MEAS_FLAGS: /* ? */ 1171 value = measure[0]. flags;1171 value = measure[0].dbFlags; 1172 1172 break; 1173 1173 case MEAS_XCCD: /* OK */ -
trunk/Ohana/src/opihi/dvo/pmeasure.c
r14590 r15038 114 114 for (k = 0; k < catalog.average[i].Nm; k++) { 115 115 if (FlagClip) { 116 flags = catalog.measure[m+k]. flags;116 flags = catalog.measure[m+k].dbFlags; 117 117 if (!(flags & FlagChoice)) continue; 118 118 } -
trunk/Ohana/src/relastro/src/UpdateImages.c
r12332 r15038 35 35 N = 0; 36 36 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 37 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;37 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 38 38 39 39 listR[N] = getMeanR (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r14590 r15038 85 85 86 86 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 87 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;87 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 88 88 89 89 R[N] = getMeanR (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); … … 178 178 m = catalog[i].average[j].offset; 179 179 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 180 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;180 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 181 181 setMeanR (fit.Ro, &catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 182 182 setMeanD (fit.Do, &catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); -
trunk/Ohana/src/relphot/src/GridOps.c
r12332 r15038 270 270 c = clist[i][j]; 271 271 272 if (catalog[c].measure[m]. flags & MEAS_BAD) continue;272 if (catalog[c].measure[m].dbFlags & MEAS_BAD) continue; 273 273 Mcal = getMcal (m, c); 274 274 if (Mcal == NO_MAG) continue; … … 321 321 c = clist[i][j]; 322 322 323 if (catalog[c].measure[m]. flags & MEAS_BAD) {323 if (catalog[c].measure[m].dbFlags & MEAS_BAD) { 324 324 Narea ++; 325 325 continue; -
trunk/Ohana/src/relphot/src/ImageOps.c
r12332 r15038 195 195 c = clist[i][j]; 196 196 197 if (catalog[c].measure[m]. flags & MEAS_BAD) continue;197 if (catalog[c].measure[m].dbFlags & MEAS_BAD) continue; 198 198 Mmos = getMmos (m, c); 199 199 if (Mmos == NO_MAG) continue; -
trunk/Ohana/src/relphot/src/MosaicOps.c
r12332 r15038 348 348 if (Mcal == NO_MAG) continue; 349 349 if (Mcal == NO_IMAGE) continue; 350 if (catalog[c].measure[m]. flags & MEAS_BAD) continue;350 if (catalog[c].measure[m].dbFlags & MEAS_BAD) continue; 351 351 if ((Mgrid = getMgrid (m, c)) == NO_MAG) continue; 352 352 if ((Mrel = getMrel (catalog, m, c)) == NO_MAG) continue; … … 593 593 c = clist[i][j]; 594 594 595 if (catalog[c].measure[m]. flags & (ID_MEAS_AREA | ID_MEAS_NOCAL)) continue;595 if (catalog[c].measure[m].dbFlags & (ID_MEAS_AREA | ID_MEAS_NOCAL)) continue; 596 596 597 597 ave = catalog[c].measure[m].averef; -
trunk/Ohana/src/relphot/src/StarOps.c
r12332 r15038 51 51 N = 0; 52 52 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 53 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;53 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 54 54 Mcal = getMcal (m, i); 55 55 if (Mcal == NO_MAG) continue; … … 110 110 m = catalog[i].average[j].offset; 111 111 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 112 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;112 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 113 113 Mcal = getMcal (m, i); 114 114 if (Mcal == NO_MAG) continue; … … 158 158 m = catalog[i].average[j].offset; 159 159 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 160 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;160 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 161 161 Mcal = getMcal (m, i); 162 162 if (Mcal == NO_MAG) continue; … … 272 272 N = 0; 273 273 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 274 /* if (catalog[i].measure[m]. flags & MEAS_BAD) continue; */274 /* if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; */ 275 275 Mcal = getMcal (m, i); 276 276 if (Mcal == NO_MAG) continue; … … 308 308 N = 0; 309 309 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 310 /* if (catalog[i].measure[m]. flags & MEAS_BAD) continue; */310 /* if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; */ 311 311 Mcal = getMcal (m, i); 312 312 if (Mcal == NO_MAG) continue; … … 329 329 for (k = 0; k < N; k++) { 330 330 if (fabs (list[k] - stats.median) > Ns*stats.sigma) { 331 catalog[i].measure[ilist[k]]. flags |= ID_MEAS_POOR;331 catalog[i].measure[ilist[k]].dbFlags |= ID_MEAS_POOR; 332 332 Ndel ++; 333 333 } -
trunk/Ohana/src/relphot/src/bcatalog.c
r12332 r15038 66 66 } 67 67 68 subcatalog[0].measure[Nmeasure]. flags &= ~ID_MEAS_SKIP;68 subcatalog[0].measure[Nmeasure].dbFlags &= ~ID_MEAS_SKIP; 69 69 subcatalog[0].measure[Nmeasure] = catalog[0].measure[offset]; 70 70 subcatalog[0].measure[Nmeasure].averef = Naverage; 71 71 if (RESET) { 72 72 subcatalog[0].measure[Nmeasure].Mcal = 0; 73 subcatalog[0].measure[Nmeasure]. flags &= 0xff00;74 subcatalog[0].measure[Nmeasure]. flags &= ~ID_MEAS_POOR;75 subcatalog[0].measure[Nmeasure]. flags &= ~ID_MEAS_AREA;76 subcatalog[0].measure[Nmeasure]. flags &= ~ID_MEAS_NOCAL;73 subcatalog[0].measure[Nmeasure].dbFlags &= 0xff00; 74 subcatalog[0].measure[Nmeasure].dbFlags &= ~ID_MEAS_POOR; 75 subcatalog[0].measure[Nmeasure].dbFlags &= ~ID_MEAS_AREA; 76 subcatalog[0].measure[Nmeasure].dbFlags &= ~ID_MEAS_NOCAL; 77 77 } 78 78 Nmeasure ++; -
trunk/Ohana/src/relphot/src/plot_scatter.c
r12332 r15038 27 27 28 28 for (k = 0; k < catalog[i].average[j].Nm; k++, m++) { 29 if (catalog[i].measure[m]. flags & MEAS_BAD) continue;29 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 30 30 Mcal = getMcal (m, i); 31 31 if (Mcal == NO_MAG) continue; -
trunk/Ohana/src/relphot/src/setExclusions.c
r12332 r15038 38 38 39 39 markbad: 40 catalog[i].measure[m]. flags |= ID_MEAS_AREA;40 catalog[i].measure[m].dbFlags |= ID_MEAS_AREA; 41 41 Narea ++; 42 42 continue; 43 43 44 44 mark_nocal: 45 catalog[i].measure[m]. flags |= ID_MEAS_NOCAL;45 catalog[i].measure[m].dbFlags |= ID_MEAS_NOCAL; 46 46 Nnocal ++; 47 47 continue; -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r12332 r15038 27 27 28 28 catalog[0].measure[m].Mcal = 0; 29 catalog[0].measure[m]. flags &= 0xff00;30 catalog[0].measure[m]. flags &= ~ID_MEAS_POOR;31 catalog[0].measure[m]. flags &= ~ID_MEAS_SKIP;32 catalog[0].measure[m]. flags &= ~ID_MEAS_AREA;33 catalog[0].measure[m]. flags &= ~ID_MEAS_NOCAL;29 catalog[0].measure[m].dbFlags &= 0xff00; 30 catalog[0].measure[m].dbFlags &= ~ID_MEAS_POOR; 31 catalog[0].measure[m].dbFlags &= ~ID_MEAS_SKIP; 32 catalog[0].measure[m].dbFlags &= ~ID_MEAS_AREA; 33 catalog[0].measure[m].dbFlags &= ~ID_MEAS_NOCAL; 34 34 } 35 35 } … … 58 58 m = catalog[0].average[i].offset; 59 59 for (j = 0; j < catalog[0].average[i].Nm; j++, m++) { 60 catalog[0].measure[m]. flags &= ~ID_MEAS_NOCAL;60 catalog[0].measure[m].dbFlags &= ~ID_MEAS_NOCAL; 61 61 } 62 62 } … … 88 88 89 89 /* clear SKIP for all measures at first */ 90 catalog[0].measure[m]. flags &= ~ID_MEAS_SKIP;90 catalog[0].measure[m].dbFlags &= ~ID_MEAS_SKIP; 91 91 92 92 /** never use these measurements (wrong photcode, bad time range) */ … … 129 129 130 130 skip: 131 catalog[0].measure[m]. flags |= ID_MEAS_SKIP;131 catalog[0].measure[m].dbFlags |= ID_MEAS_SKIP; 132 132 Nskip ++; 133 133 }
Note:
See TracChangeset
for help on using the changeset viewer.
