Changeset 21418
- Timestamp:
- Feb 8, 2009, 12:36:43 PM (17 years ago)
- Location:
- branches/eam_branch_20090208/Ohana/src
- Files:
-
- 9 added
- 24 edited
-
libautocode/Makefile.Targets (modified) (11 diffs)
-
libautocode/def/average-ps1-v1.d (added)
-
libautocode/def/average.d (modified) (2 diffs)
-
libautocode/def/cmf-ps1-v1.d (added)
-
libautocode/def/getstar-ps1-v1.d (added)
-
libautocode/def/image-ps1-v1.d (added)
-
libautocode/def/image.d (modified) (3 diffs)
-
libautocode/def/measure-ps1-v1.d (added)
-
libautocode/def/measure.d (modified) (5 diffs)
-
libautocode/def/photcode-ps1-v1.d (added)
-
libautocode/def/secfilt-ps1-v1.d (added)
-
libautocode/def/secfilt.d (modified) (2 diffs)
-
libautocode/doc/autocode.txt (modified) (1 diff)
-
libautocode/generate (modified) (6 diffs)
-
libdvo/Makefile (modified) (2 diffs)
-
libdvo/doc/notes.txt (modified) (3 diffs)
-
libdvo/include/dvo.h (modified) (2 diffs)
-
libdvo/include/ps1_v1_defs.h (added)
-
libdvo/src/LoadPhotcodesFITS.c (modified) (2 diffs)
-
libdvo/src/SavePhotcodesFITS.c (modified) (1 diff)
-
libdvo/src/dvo_catalog.c (modified) (1 diff)
-
libdvo/src/dvo_catalog_raw.c (modified) (8 diffs)
-
libdvo/src/dvo_convert.c (modified) (9 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (15 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (17 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_3.c (modified) (6 diffs)
-
libdvo/src/dvo_convert_PS1_V1.c (added)
-
libdvo/src/dvo_convert_elixir.c (modified) (18 diffs)
-
libdvo/src/dvo_convert_loneos.c (modified) (15 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (15 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (15 diffs)
-
libdvo/src/dvo_image.c (modified) (1 diff)
-
libdvo/src/dvo_image_raw.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20090208/Ohana/src/libautocode/Makefile.Targets
r21408 r21418 1 2 1 AOBJS = \ 3 2 $(ASRC)/coords.$(ARCH).o \ … … 9 8 $(ASRC)/average-ps1-dev-1.$(ARCH).o \ 10 9 $(ASRC)/average-ps1-dev-2.$(ARCH).o \ 10 $(ASRC)/average-ps1-v1.$(ARCH).o \ 11 11 $(ASRC)/secfilt.$(ARCH).o \ 12 12 $(ASRC)/secfilt-loneos.$(ARCH).o \ … … 16 16 $(ASRC)/secfilt-ps1-dev-1.$(ARCH).o \ 17 17 $(ASRC)/secfilt-ps1-dev-2.$(ARCH).o \ 18 $(ASRC)/secfilt-ps1-v1.$(ARCH).o \ 18 19 $(ASRC)/measure.$(ARCH).o \ 19 20 $(ASRC)/measure-loneos.$(ARCH).o \ … … 23 24 $(ASRC)/measure-ps1-dev-1.$(ARCH).o \ 24 25 $(ASRC)/measure-ps1-dev-2.$(ARCH).o \ 26 $(ASRC)/measure-ps1-v1.$(ARCH).o \ 25 27 $(ASRC)/missing.$(ARCH).o \ 26 28 $(ASRC)/photcode.$(ARCH).o \ … … 29 31 $(ASRC)/photcode-ps1-dev-2.$(ARCH).o \ 30 32 $(ASRC)/photcode-ps1-dev-3.$(ARCH).o \ 33 $(ASRC)/photcode-ps1-v1.$(ARCH).o \ 31 34 $(ASRC)/image.$(ARCH).o \ 32 35 $(ASRC)/image-loneos.$(ARCH).o \ … … 37 40 $(ASRC)/image-ps1-dev-2.$(ARCH).o \ 38 41 $(ASRC)/image-ps1-dev-3.$(ARCH).o \ 42 $(ASRC)/image-ps1-v1.$(ARCH).o \ 39 43 $(ASRC)/regimage.$(ARCH).o \ 40 44 $(ASRC)/detreg.$(ARCH).o \ … … 63 67 $(AINC)/average-ps1-dev-1.h \ 64 68 $(AINC)/average-ps1-dev-2.h \ 69 $(AINC)/average-ps1-v1.h \ 65 70 $(AINC)/secfilt.h \ 66 71 $(AINC)/secfilt-loneos.h \ … … 70 75 $(AINC)/secfilt-ps1-dev-1.h \ 71 76 $(AINC)/secfilt-ps1-dev-2.h \ 77 $(AINC)/secfilt-ps1-v1.h \ 72 78 $(AINC)/measure.h \ 73 79 $(AINC)/measure-loneos.h \ … … 77 83 $(AINC)/measure-ps1-dev-1.h \ 78 84 $(AINC)/measure-ps1-dev-2.h \ 85 $(AINC)/measure-ps1-v1.h \ 79 86 $(AINC)/missing.h \ 80 87 $(AINC)/photcode.h \ … … 83 90 $(AINC)/photcode-ps1-dev-2.h \ 84 91 $(AINC)/photcode-ps1-dev-3.h \ 92 $(AINC)/photcode-ps1-v1.h \ 85 93 $(AINC)/image.h \ 86 94 $(AINC)/image-loneos.h \ … … 91 99 $(AINC)/image-ps1-dev-2.h \ 92 100 $(AINC)/image-ps1-dev-3.h \ 101 $(AINC)/image-ps1-v1.h \ 93 102 $(AINC)/regimage.h \ 94 103 $(AINC)/detreg.h \ -
branches/eam_branch_20090208/Ohana/src/libautocode/def/average.d
r16810 r21418 2 2 EXTNAME DVO_AVERAGE 3 3 TYPE BINTABLE 4 SIZE 804 SIZE 94 5 5 DESCRIPTION DVO Average Object Table 6 6 7 7 # elements of data structure / FITS table 8 8 9 FIELD R, RA, double, RA, decimal degrees 10 FIELD D, DEC, double, DEC, decimal degrees 11 FIELD dR, RA_ERR, float, RA error arcsec 12 FIELD dD, DEC_ERR, float, DEC error arcsec 9 FIELD R, RA, double, RA, decimal degrees 10 FIELD D, DEC, double, DEC, decimal degrees 11 FIELD dR, RA_ERR, float, RA error arcsec 12 FIELD dD, DEC_ERR, float, DEC error arcsec 13 14 FIELD uR, U_RA, float, RA*cos(D) proper-motion, arcsec/year 15 FIELD uD, U_DEC, float, DEC proper-motion, arcsec/year 16 FIELD duR, V_RA_ERR, float, RA*cos(D) p-m error, arcsec/year 17 FIELD duD, V_DEC_ERR, float, DEC p-m error, arcsec/year 18 FIELD P, PAR, float, parallax, arcsec 19 FIELD dP, PAR_ERR, float, parallax error, arcsec 13 20 14 FIELD uR, U_RA, float, RA*cos(D) proper-motion, arcsec/year 15 FIELD uD, U_DEC, float, DEC proper-motion, arcsec/year 16 FIELD duR, V_RA_ERR, float, RA*cos(D) p-m error, arcsec/year 17 FIELD duD, V_DEC_ERR, float, DEC p-m error, arcsec/year 18 FIELD P, PAR, float, parallax, arcsec 19 FIELD dP, PAR_ERR, float, parallax error, arcsec 21 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 22 FIELD ChiSq, CHISQ_POS, float, astrometry analysis chisq 23 FIELD Npos, NUMBER_POS, unsigned short, number of detections used for astrometry 20 24 21 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 25 # this limits us to a max of 64k measurements per object 22 26 FIELD Nmeasure, NMEASURE, unsigned short, number of psf measurements 23 27 FIELD Nmissing, NMISSING, unsigned short, number of missings 24 28 FIELD Nextend, NEXTEND, unsigned short, number of extended measurements 25 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement26 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs27 FIELD extendOffset, OFF_EXTEND, int, offset to first extended measurement28 29 29 FIELD code, code, unsigned short, ID code (star; ghost; etc) 30 FIELD dummy, DUMMY, char[2], padding 30 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement 31 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs 32 FIELD extendOffset, OFF_EXTEND, int, offset to first extended measurement 31 33 32 # Pan-STARRS uses a 64-bit detection ID. keep this in two 32 bit ints 33 # for C89 compatibility. The objID is constructed based on the 34 # position of first instatiation. this is actually quite expensive 35 # because we need to include the uniqueness test to construct this, 36 # which requires a select for each new object. Therefore, I will use 37 # a table based ID (table ID + object ID), and we will have to 38 # re-number the object IDs if we change the table density, OR treat 39 # all subdivisions as entries which are from a foreign table. 34 # 'flags' was called 'code' prior to 2009.02.07 35 FIELD flags, FLAGS, uint32_t, average object flags (star; ghost; etc) 40 36 41 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 42 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 37 # objID + catID gives a unique ID for all objects in the database 38 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 39 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 40 FIELD extID, EXT_ID, uint64_t, external ID for object (eg PSPS objID) 43 41 44 42 # this structure should only be used for internal representations … … 47 45 # the index for the secfilt table is just Nsecfilt times the index for the average table. 48 46 49 # the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs 50 # probably need to add position chisq 51 52 # XXX include the number of measurements used to determine the positional information? 47 # *** 20090206 : new fields : ChiSq, Npos, flags (was code, uint16_t), extID -
branches/eam_branch_20090208/Ohana/src/libautocode/def/image.d
r20936 r21418 40 40 # 40 bytes 41 41 42 FIELD name, NAME, char[12 8], name of original image42 FIELD name, NAME, char[121], name of original image 43 43 FIELD detection_limit, DETECTION_LIMIT, unsigned char, detection limit, 10*mag 44 44 FIELD saturation_limit, SATURATION_LIMIT, unsigned char, saturation limit, 10*mag … … 47 47 FIELD fwhm_y, FWHM_Y, unsigned char, PSF y width, 25*arcsec 48 48 FIELD trate, TRATE, unsigned char, scan rate, 100 usec/pixel 49 FIELD code, CODE, char, image quality flag50 49 FIELD ccdnum, CCDNUM, unsigned char, CCD ID number 50 FIELD flags, FLAGS, unsigned int, image quality flags 51 51 FIELD imageID, IMAGE_ID, unsigned int, internal image ID 52 53 # XXX do we want to use this to handle mosaics? 54 # FIELD parentID, PARENT_ID, unsigned int, associated ref image 52 FIELD parentID, PARENT_ID, unsigned int, associated ref image 55 53 FIELD externID, EXTERN_ID, unsigned int, external image ID 56 54 FIELD sourceID, SOURCE_ID, unsigned short, analysis source ID … … 73 71 FIELD Myyyy, MYYYY, short, Mrel polyterm 74 72 # 40 bytes 73 74 # *** 20090206 : new fields : parentID, flags (was code char), changed name to 121 bytes. -
branches/eam_branch_20090208/Ohana/src/libautocode/def/measure.d
r16810 r21418 2 2 EXTNAME DVO_MEASURE 3 3 TYPE BINTABLE 4 SIZE 1 124 SIZE 139 5 5 DESCRIPTION DVO Detection Measurement Table 6 6 … … 10 10 FIELD Mcal, M_CAL, float, image cal mag, mag 11 11 FIELD Map, M_APER, float, aperture mag, mag 12 FIELD Map_small, M_APER_SMALL, float, small aperture mag, mag 12 13 FIELD dM, MAG_ERR, float, mag error, mag 13 14 FIELD dMcal, MAG_CAL_ERR, float, systematic calibration error, mag 14 15 FIELD dt, M_TIME, float, exposure time, 2.5*log(exptime) 16 15 17 16 18 # note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation … … 26 28 FIELD dSky, SKY_FLUX_ERR, float, local estimate of sky flux, counts/sec 27 29 28 FIELD t, TIME, unsigned int, time in seconds (UNIX) 30 FIELD t, TIME, int, time in seconds (UNIX) 31 FIELD t_msec, TIME_MSEC, unsigned short, time fraction of second, milliseconds 29 32 FIELD averef, AVE_REF, unsigned int, reference to average entry 30 33 … … 32 35 FIELD detID, DET_ID, unsigned int, detection ID 33 36 FIELD imageID, IMAGE_ID, unsigned int, reference to DVO image ID 37 FIELD extID, EXT_ID, uint64_t, external ID (eg PSPS detID) 34 38 35 39 # do we need more resolution than a short? should this be a log? 36 FIELD qPSF,PSF_QF, float, psf coverage/quality factor40 FIELD psfQual, PSF_QF, float, psf coverage/quality factor 37 41 FIELD psfChisq, PSF_CHISQ, float, psf fit chisq 38 42 FIELD crNsigma, CR_NSIGMA, float, Nsigma deviation towards CR … … 42 46 FIELD FWy, FWHM_MINOR, short, object fwhm minor axis, 1/100 of arcsec 43 47 FIELD theta, PSF_THETA, short, angle wrt ccd X dir, (0xffff/360) deg 44 FIELD photcode, PHOTCODE, unsigned short, photcode 48 49 # moments 50 FIELD Mxx, MXX, short, second moments in pixel coords, 1/100 of arcsec 51 FIELD Mxy, MXY, short, second moments in pixel coords, 1/100 of arcsec 52 FIELD Myy, MYY, short, second moments in pixel coords, 1/100 of arcsec 45 53 46 54 # convert this to error in arcsec on load? 47 55 FIELD dXccd, X_CCD_ERR, short, X coord error on chip, pixels 48 56 FIELD dYccd, Y_CCD_ERR, short, Y coord error on chip, pixels 57 FIELD dTccd, T_CCD_ERR, short, position angle chip to sky, (0xffff/360) deg 49 58 50 FIELD dbFlags, DB_FLAGS, unsigned short, flags for various uses 51 FIELD photFlags, PHOT_FLAGS, unsigned short, flags supplied by photometry program 59 FIELD photcode, PHOTCODE, unsigned short, photcode 60 FIELD dbFlags, DB_FLAGS, uint64_t, flags supplied by analysis in database 61 FIELD photFlags, PHOT_FLAGS, uint64_t, flags supplied by photometry program 52 62 53 63 FIELD stargal, STAR_GAL, char, star-galaxy separator 54 64 55 # absorb these into photFlags?56 FIELD dophot, DOPHOT, char, dophot type 65 # *** 20090206 : new fields : t_msec, extID, Mxx, Mxy, Myy, dTccd; deprecated dophot 66 # dbFlags, photFlags : uint16_t to uint64_t 57 67 58 FIELD dummy, DUMMY, char[6], padding 68 # XXX unsigned int values are probably not being saved in the FITS file correctly: no BZERO, BSCALE -
branches/eam_branch_20090208/Ohana/src/libautocode/def/secfilt.d
r12332 r21418 2 2 EXTNAME DVO_SECFILT 3 3 TYPE BINTABLE 4 SIZE 1 64 SIZE 18 5 5 DESCRIPTION DVO SecFilt : Secondary Filter Data 6 6 … … 11 11 FIELD Ncode, NCODE, short, number of detections in band 12 12 FIELD Nused, NUSED, short, number of detections used in average 13 FIELD dummy, JUNK, short, place holder 13 FIELD M_20, MAG_20, short, lower 20percent mag, millimags 14 FIELD M_80, MAG_80, short, upper 20percent mag, millimags 15 16 # *** 20090206 : new fields : M_20, M_80; dropped dummy -
branches/eam_branch_20090208/Ohana/src/libautocode/doc/autocode.txt
r3515 r21418 1 2 2009.02.07 3 4 The autocode tables currently use type names which are ambiguous in 5 terms of their actual sizes in bits. I've added the intNN_t and 6 uintNN_t types -- this requires --use-gnu99 with configure 7 8 see libdvo/doc/notes.txt for instructions on adding new dvo catalog formats 9 10 2007.00.00 1 11 2 12 This directory contains a collection of autocoded FITS I/O routines -
branches/eam_branch_20090208/Ohana/src/libautocode/generate
r7080 r21418 114 114 115 115 # rawshort is a short without byteswapping 116 # rawshort is a patch for old photreg tables 116 117 117 118 $pt1 = 0; … … 124 125 if ($type eq "int") { $pt1 = "J"; } 125 126 if ($type eq "unsigned int") { $pt1 = "J"; } 126 if ($type eq "e_time") { $pt1 = "J"; } 127 128 if ($type eq "int8_t") { $pt1 = "B"; } 129 if ($type eq "uint8_t") { $pt1 = "B"; } 130 if ($type eq "int16_t") { $pt1 = "I"; } 131 if ($type eq "uint16_t") { $pt1 = "I"; } 132 if ($type eq "int32_t") { $pt1 = "J"; } 133 if ($type eq "uint32_t") { $pt1 = "J"; } 134 135 # FITS tables do not allow for 64bit integers. we need to 136 # write these by splitting the value into high and low 32 bit values 137 if ($type eq "int64_t") { $pt1 = "J"; $Np = 2*$Np; } 138 if ($type eq "uint64_t") { $pt1 = "J"; $Np = 2*$Np; } 139 127 140 if ($type eq "float") { $pt1 = "E"; } 128 141 if ($type eq "double") { $pt1 = "D"; } 129 142 143 # special 'elixir' types: 144 if ($type eq "e_time") { $pt1 = "J"; } 130 145 if ($type eq "e_void") { $pt1 = "B"; $Np = 8*$Np; } 131 146 # e_void is a 64 bit pointer, cast to size_t. its value is not loaded … … 146 161 printf FILE "%-20s 1.0, 0.0);\n", "\"$unit[$i]\", "; 147 162 } 148 149 163 } 150 164 … … 217 231 if ($type eq "int") { $pt1 = sprintf "I%s", $length; } 218 232 if ($type eq "unsigned int") { $pt1 = sprintf "I%s", $length; } 219 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 233 234 if ($type eq "int8_t") { $pt1 = sprintf "I%s", $length; } 235 if ($type eq "uint8_t") { $pt1 = sprintf "I%s", $length; } 236 if ($type eq "int16_t") { $pt1 = sprintf "I%s", $length; } 237 if ($type eq "uint16_t") { $pt1 = sprintf "I%s", $length; } 238 if ($type eq "int32_t") { $pt1 = sprintf "I%s", $length; } 239 if ($type eq "uint32_t") { $pt1 = sprintf "I%s", $length; } 240 241 # FITS tables do not allow for 64bit integers. we need to 242 # write these by splitting the value into high and low 32 bit values 243 if ($type eq "int64_t") { $pt1 = sprintf "I%s", $length; } 244 if ($type eq "uint64_t") { $pt1 = sprintf "I%s", $length; } 245 220 246 if ($type eq "float") { $pt1 = sprintf "F%s", $length; } 221 247 if ($type eq "double") { $pt1 = sprintf "F%s", $length; } 222 248 249 # special 'elixir' types: 250 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 223 251 if ($type eq "e_void") { $pt1 = sprintf "I%s", $length; } 224 252 … … 283 311 if ($type eq "unsigned char") { $N += $Np; next; } 284 312 if ($type eq "rawshort") { $N += 2*$Np; next; } 313 285 314 if ($type eq "short") { $T = "BYTE"; $n = 2; } 286 315 if ($type eq "unsigned short"){ $T = "BYTE"; $n = 2; } 287 316 if ($type eq "int") { $T = "WORD"; $n = 4; } 288 317 if ($type eq "unsigned int") { $T = "WORD"; $n = 4; } 318 319 if ($type eq "int8_t") { $N += $Np; next; } 320 if ($type eq "uint8_t") { $N += $Np; next; } 321 if ($type eq "int16_t") { $T = "BYTE"; $n = 2; } 322 if ($type eq "uint16_t") { $T = "BYTE"; $n = 2; } 323 if ($type eq "int32_t") { $T = "WORD"; $n = 4; } 324 if ($type eq "uint32_t") { $T = "WORD"; $n = 4; } 325 326 # FITS tables do not allow for 64bit integers. we need to 327 # write these by splitting the value into high and low 32 bit values 328 if ($type eq "int64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 329 if ($type eq "uint64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 330 331 if ($type eq "float") { $T = "WORD"; $n = 4; } 332 if ($type eq "double") { $T = "DBLE"; $n = 8; } 333 334 # special 'elixir' types: 289 335 if ($type eq "e_time") { $T = "WORD"; $n = 4; } 290 336 if ($type eq "e_void") { $T = "DBLE"; $n = 8; } 291 if ($type eq "float") { $T = "WORD"; $n = 4; } 292 if ($type eq "double") { $T = "DBLE"; $n = 8; } 337 293 338 if (!$n) { die "unknown type $type"; } 294 339 for ($j = 0; $j < $Np; $j++) { … … 318 363 if ($type eq "int") { $Nbytes += 4*$Np; $valid = 1; } 319 364 if ($type eq "unsigned int") { $Nbytes += 4*$Np; $valid = 1; } 365 366 if ($type eq "int8_t") { $Nbytes += 1*$Np; $valid = 1; } 367 if ($type eq "uint8_t") { $Nbytes += 1*$Np; $valid = 1; } 368 if ($type eq "int16_t") { $Nbytes += 2*$Np; $valid = 1; } 369 if ($type eq "uint16_t") { $Nbytes += 2*$Np; $valid = 1; } 370 if ($type eq "int32_t") { $Nbytes += 4*$Np; $valid = 1; } 371 if ($type eq "uint32_t") { $Nbytes += 4*$Np; $valid = 1; } 372 373 # FITS tables do not allow for 64bit integers. we need to 374 # write these by splitting the value into high and low 32 bit values 375 if ($type eq "int64_t") { $Nbytes += 8*$Np; $valid = 1; } 376 if ($type eq "uint64_t") { $Nbytes += 8*$Np; $valid = 1; } 377 378 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; } 379 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; } 380 381 # special 'elixir' types: 320 382 if ($type eq "e_time") { $Nbytes += 4*$Np; $valid = 1; } 321 383 if ($type eq "e_void") { $Nbytes += 8*$Np; $valid = 1; } 322 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; }323 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; }324 384 if (!$valid) { die "unknown type $type"; } 325 385 } -
branches/eam_branch_20090208/Ohana/src/libdvo/Makefile
r17419 r21418 31 31 $(DESTINC)/ps1_dev_1_defs.h \ 32 32 $(DESTINC)/ps1_dev_2_defs.h \ 33 $(DESTINC)/ps1_dev_3_defs.h 33 $(DESTINC)/ps1_dev_3_defs.h \ 34 $(DESTINC)/ps1_v1_defs.h 34 35 35 36 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h … … 65 66 $(SRC)/dvo_convert_PS1_DEV_2.$(ARCH).o \ 66 67 $(SRC)/dvo_convert_PS1_DEV_3.$(ARCH).o \ 68 $(SRC)/dvo_convert_PS1_V1.$(ARCH).o \ 67 69 $(SRC)/skyregion_io.$(ARCH).o \ 68 70 $(SRC)/skyregion_gsc.$(ARCH).o \ -
branches/eam_branch_20090208/Ohana/src/libdvo/doc/notes.txt
r12332 r21418 2 2 Adding a new dvo catalog format. Assume the new format name is 'foo'. 3 3 4 1) create the autocode definition files for average, measure, secfilt, image5 these files must be a subset of the internal versions of these same6 tables. if you intend to add fields which don't exist in the7 internal tables, you must update the internal tables as well. the8 naming convention is: average-foo.d, etc.4 1) create the autocode definition files for average, measure, secfilt, 5 image, and photcode. these files must be a subset of the internal 6 versions of these same tables. if you intend to add fields which 7 don't exist in the internal tables, you must update the internal 8 tables as well. the naming convention is: average-foo.d, etc. 9 9 10 10 2) add the new definition files to libautocode/Makefile.Targets (both … … 22 22 (libdvo/src/dvo_catalog.c). The name should be "FOO". 23 23 24 6) add entry for structure size in dvo_catalog_load_raw 25 (libdvo/src/dvo_catalog_raw.c), since this is not available from 26 the header. 24 6) in libdvo/src/dvo_catalog_raw.c, update the FORMAT_CASE lists to 25 include the new STRUCT name. 27 26 28 7) add entries in ReadRawAverage, WriteRawAverage, ReadRawMeasure, 29 WriteRawMeasure, ReadRawSecFilt, WriteRawSecFilt. Make sure to use 30 the new STRUCT names. the conversion function gfit_convert_Foo will 31 be automatically generated. 27 7) create a new conversion file dvo_convert_foo.c and define the 28 internal to Foo conversions. 32 29 33 8) add entry in WriteRawAverage, making sure to use the new STRUCT 34 name. the conversion function gfit_convert_Foo will be 35 automatically generated. 30 8) add the new format to the list of FORMAT conversion in dvo_convert.c. 36 31 37 9) create a new conversion file dvo_convert_foo.c and define the 38 internal to Foo conversions. 32 9) any changes to the internal format need to be reflected in the 33 functions in the dvo_convert_*.c files. These files are defined so 34 that changed fields are sequential in the functions. This should 35 make is easy to identify the new changes needed. 36 37 10) add the new format to the section at the end of dvo_image.c 38 39 11) add the new format to the dvo_image_raw.c 40 41 12) add the photcode format conversions to libdvo/src/LoadPhotcodesFITS.c 42 43 12) switch the output photcode format conversion ina libdvo/src/SavePhotcodesFITS.c 44 45 13) Add the conversion functions to the header file libdvo/include/foo_defs.h 39 46 40 47 * Note some esoteric format issues: … … 54 61 keywords. 55 62 63 ---- 64 65 20090207 : adding PS1_V1 66 67 measure: 68 new fields : t_msec, extID, Mxx, Mxy, Myy, dTccd; deprecated dophot 69 dbFlags, photFlags : uint16_t to uint64_t 70 71 average: 72 new fields : ChiSq, Npos, flags (was code, uint16_t), extID 73 74 secfilt: 75 new fields : M_20, M_80; dropped dummy 76 77 image: 78 new fields : parentID, flags (was code char), changed name to 121 bytes. 79 80 photcode: 81 new fields : NONE 82 83 ** parentID was added to enable easy lookups from chip->fpa for mosaic 84 astrometry. In old databases, this conversion was done by making 85 the match via the time and photcode. This conversion needs to be 86 done on load... -
branches/eam_branch_20090208/Ohana/src/libdvo/include/dvo.h
r21408 r21418 18 18 DVO_FORMAT_PS1_DEV_1, 19 19 DVO_FORMAT_PS1_DEV_2, 20 DVO_FORMAT_PS1_DEV_3 20 DVO_FORMAT_PS1_DEV_3, 21 DVO_FORMAT_PS1_V1 21 22 } DVOTableFormat; 22 23 … … 407 408 # include "ps1_dev_2_defs.h" 408 409 # include "ps1_dev_3_defs.h" 410 # include "ps1_v1_defs.h" 409 411 410 412 /*** DVO image db I/O Functions ***/ -
branches/eam_branch_20090208/Ohana/src/libdvo/src/LoadPhotcodesFITS.c
r17190 r21418 40 40 gfits_scan (&db.theader, "EXTNAME", "%s", 1, extname); 41 41 42 if (!strcmp (extname, "DVO_PHOTCODE") || !strcmp (extname, "DVO_PHOTCODE_ELIXIR")) { 42 if (!strcmp (extname, "DVO_PHOTCODE")) { 43 PhotCode_Elixir *photcode_elixir = gfits_table_get_PhotCode_Elixir (&db.ftable, &Ncode, &db.swapped); 44 photcode = PhotCode_Elixir_To_Internal (photcode_elixir, Ncode); 45 free (photcode_elixir); 46 } 47 48 if (!strcmp (extname, "DVO_PHOTCODE_ELIXIR")) { 43 49 PhotCode_Elixir *photcode_elixir = gfits_table_get_PhotCode_Elixir (&db.ftable, &Ncode, &db.swapped); 44 50 photcode = PhotCode_Elixir_To_Internal (photcode_elixir, Ncode); … … 62 68 photcode = PhotCode_PS1_DEV_3_To_Internal (photcode_ps1_dev_3, Ncode); 63 69 free (photcode_ps1_dev_3); 70 } 71 72 if (!strcmp (extname, "DVO_PHOTCODE_PS1_V1")) { 73 PhotCode_PS1_V1 *photcode_ps1_v1 = gfits_table_get_PhotCode_PS1_V1 (&db.ftable, &Ncode, &db.swapped); 74 photcode = PhotCode_PS1_V1_To_Internal (photcode_ps1_v1, Ncode); 75 free (photcode_ps1_v1); 64 76 } 65 77 -
branches/eam_branch_20090208/Ohana/src/libdvo/src/SavePhotcodesFITS.c
r17190 r21418 29 29 // for the moment, we simply support the latest photcode format for output 30 30 // XXX update this as needed as new formats are defined 31 PhotCode_PS1_ DEV_3 *photcode_output = PhotCode_Internal_To_PS1_DEV_3(table[0].code, table[0].Ncode);31 PhotCode_PS1_V1 *photcode_output = PhotCode_Internal_To_PS1_V1 (table[0].code, table[0].Ncode); 32 32 33 33 /* convert FITS format data to internal format (byteswaps & EXTNAME) */ 34 34 gfits_db_create (&db); 35 gfits_table_set_PhotCode_PS1_ DEV_3(&db.ftable, photcode_output, table[0].Ncode);35 gfits_table_set_PhotCode_PS1_V1 (&db.ftable, photcode_output, table[0].Ncode); 36 36 gfits_db_save (&db); 37 37 gfits_db_close (&db); -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_catalog.c
r20981 r21418 52 52 if (!strcasecmp (catformat, "PS1_DEV_1")) return (DVO_FORMAT_PS1_DEV_1); 53 53 if (!strcasecmp (catformat, "PS1_DEV_2")) return (DVO_FORMAT_PS1_DEV_2); 54 if (!strcasecmp (catformat, "PS1_V1")) return (DVO_FORMAT_PS1_V1); 54 55 return (DVO_FORMAT_UNDEF); 55 56 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_catalog_raw.c
r20982 r21418 86 86 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 87 87 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 88 FORMAT_CASE (PS1_V1, PS1_V1); 88 89 89 90 default: … … 271 272 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_1"); 272 273 if (catalog[0].catformat == DVO_FORMAT_PS1_DEV_2) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 274 if (catalog[0].catformat == DVO_FORMAT_PS1_V1) gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V1"); 273 275 274 276 /* rewind file pointers and truncate file */ … … 366 368 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 367 369 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 370 FORMAT_CASE (PS1_V1, PS1_V1); 368 371 369 372 default: … … 412 415 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 413 416 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 417 FORMAT_CASE (PS1_V1, PS1_V1); 414 418 415 419 default: … … 462 466 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 463 467 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 468 FORMAT_CASE (PS1_V1, PS1_V1); 464 469 465 470 default: … … 508 513 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 509 514 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 515 FORMAT_CASE (PS1_V1, PS1_V1); 510 516 511 517 default: … … 558 564 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 559 565 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 566 FORMAT_CASE (PS1_V1, PS1_V1); 560 567 561 568 default: … … 604 611 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 605 612 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 613 FORMAT_CASE (PS1_V1, PS1_V1); 606 614 607 615 default: -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert.c
r21408 r21418 49 49 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 50 50 CONVERT_FORMAT ("DVO_AVERAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 51 CONVERT_FORMAT ("DVO_AVERAGE_PS1_V1", PS1_V1, PS1_V1); 51 52 # undef CONVERT_FORMAT 52 53 … … 79 80 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 80 81 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 82 FORMAT_CASE (PS1_V1, PS1_V1); 81 83 # undef FORMAT_CASE 82 84 … … 122 124 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 123 125 CONVERT_FORMAT ("DVO_MEASURE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 126 CONVERT_FORMAT ("DVO_MEASURE_PS1_V1", PS1_V1, PS1_V1); 124 127 # undef CONVERT_FORMAT 125 128 … … 152 155 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 153 156 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 157 FORMAT_CASE (PS1_V1, PS1_V1); 154 158 # undef FORMAT_CASE 155 159 … … 195 199 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 196 200 CONVERT_FORMAT ("DVO_SECFILT_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 201 CONVERT_FORMAT ("DVO_SECFILT_PS1_V1", PS1_V1, PS1_V1); 197 202 # undef CONVERT_FORMAT 198 203 … … 225 230 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 226 231 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 232 FORMAT_CASE (PS1_V1, PS1_V1); 227 233 # undef FORMAT_CASE 228 234 … … 288 294 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_1", PS1_DEV_1, PS1_DEV_1); 289 295 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_2", PS1_DEV_2, PS1_DEV_2); 290 CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_3", PS1_DEV_3, PS1_DEV_3); 296 CONVERT_FORMAT ("DVO_IMAGE_PS1_V1", PS1_V1, PS1_V1); 297 298 // XXX Not sure this was ever actually used -- it was not complete... 299 // CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_3", PS1_DEV_3, PS1_DEV_3); 300 291 301 # undef CONVERT_FORMAT 292 302 … … 322 332 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 323 333 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 324 FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 334 FORMAT_CASE (PS1_V1, PS1_V1); 335 336 // XXX not sure this was actually used: it was incomplete 337 // FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 325 338 # undef FORMAT_CASE 326 339 … … 372 385 FORMAT_CASE (PS1_DEV_1, PS1_DEV_1); 373 386 FORMAT_CASE (PS1_DEV_2, PS1_DEV_2); 374 FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 387 FORMAT_CASE (PS1_V1, PS1_V1); 388 389 // XXX not sure this was used, it was incomplete 390 // FORMAT_CASE (PS1_DEV_3, PS1_DEV_3); 391 375 392 # undef FORMAT_CASE 376 393 -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r21408 r21418 15 15 out[i].M = in[i].M; 16 16 out[i].Mcal = in[i].Mcal; 17 out[i].Map = in[i].Mgal;18 17 out[i].dM = in[i].dM; 19 18 out[i].dt = in[i].dt; … … 28 27 out[i].detID = in[i].detID; 29 28 out[i].imageID = in[i].imageID; 30 out[i]. qPSF = in[i].qPSF;29 out[i].psfQual = in[i].psfQual; 31 30 out[i].psfChisq = in[i].psfChisq; 32 31 out[i].crNsigma = in[i].crNsigma; … … 41 40 out[i].photFlags = in[i].photFlags; 42 41 out[i].stargal = in[i].stargal; 43 out[i].dophot = in[i].dophot; 42 43 // changed or added for PS1_DEV_2 44 out[i].Map = in[i].Mgal; 45 out[i].dMcal = 0; 46 47 // changed or added for PS1_V1 48 out[i].photFlags = in[i].photFlags | (in[i].dophot << 16); 49 out[i].t_msec = 0; 50 out[i].extID = 0; 51 out[i].Mxx = 0.0; 52 out[i].Mxy = 0.0; 53 out[i].Myy = 0.0; 54 out[i].dTccd = 0; 55 out[i].Map_small = 0; 44 56 } 45 57 return (out); … … 58 70 out[i].M = in[i].M; 59 71 out[i].Mcal = in[i].Mcal; 60 out[i].Mgal = in[i].Map;61 72 out[i].dM = in[i].dM; 62 73 out[i].dt = in[i].dt; … … 71 82 out[i].detID = in[i].detID; 72 83 out[i].imageID = in[i].imageID; 73 out[i]. qPSF = in[i].qPSF;84 out[i].psfQual = in[i].psfQual; 74 85 out[i].psfChisq = in[i].psfChisq; 75 86 out[i].crNsigma = in[i].crNsigma; … … 82 93 out[i].dYccd = in[i].dYccd; 83 94 out[i].dbFlags = in[i].dbFlags; 84 out[i].photFlags = in[i].photFlags;85 95 out[i].stargal = in[i].stargal; 86 out[i].dophot = in[i].dophot; 96 97 // changed or added for PS1_DEV_2 98 out[i].Mgal = in[i].Map; 99 100 // changed or added for PS1_V1 101 out[i].photFlags = in[i].photFlags & 0x0000ffff; 102 out[i].dophot = in[i].photFlags >> 16; 87 103 } 88 104 return (out); … … 101 117 out[i].D = in[i].D; 102 118 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm;104 out[i].Nmissing = in[i].Nn;105 out[i].code = in[i].code;106 out[i].measureOffset = in[i].offset;107 out[i].missingOffset = in[i].missing;108 119 out[i].dR = in[i].dR; 109 120 out[i].dD = in[i].dD; … … 116 127 out[i].objID = in[i].objID; 117 128 out[i].catID = in[i].catID; 129 130 // changed or added for PS1_DEV_2 131 out[i].Nmeasure = in[i].Nm; 132 out[i].Nmissing = in[i].Nn; 133 out[i].measureOffset = in[i].offset; 134 out[i].missingOffset = in[i].missing; 135 out[i].Nextend = 0; 136 out[i].extendOffset = 0; 137 138 // changed or added for PS1_V1 139 out[i].flags = in[i].code; 140 out[i].ChiSq = 0.0; 141 out[i].Npos = 0.0; 142 out[i].extID = 0; 118 143 } 119 144 return (out); … … 129 154 130 155 for (i = 0; i < Nvalues; i++) { 131 out[i].R = in[i].R; 132 out[i].D = in[i].D; 133 out[i].Xp = in[i].Xp; 134 out[i].Nm = in[i].Nmeasure; 135 out[i].Nn = in[i].Nmissing; 136 out[i].code = in[i].code; 137 out[i].offset = in[i].measureOffset; 138 out[i].missing = in[i].missingOffset; 139 out[i].dR = in[i].dR; 140 out[i].dD = in[i].dD; 141 out[i].uR = in[i].uR; 142 out[i].uD = in[i].uD; 143 out[i].duR = in[i].duR; 144 out[i].duD = in[i].duD; 145 out[i].P = in[i].P; 146 out[i].dP = in[i].dP; 147 out[i].objID = in[i].objID; 148 out[i].catID = in[i].catID; 156 out[i].R = in[i].R; 157 out[i].D = in[i].D; 158 out[i].Xp = in[i].Xp; 159 out[i].dR = in[i].dR; 160 out[i].dD = in[i].dD; 161 out[i].uR = in[i].uR; 162 out[i].uD = in[i].uD; 163 out[i].duR = in[i].duR; 164 out[i].duD = in[i].duD; 165 out[i].P = in[i].P; 166 out[i].dP = in[i].dP; 167 out[i].objID = in[i].objID; 168 out[i].catID = in[i].catID; 169 170 // changed or added for PS1_DEV_2 171 out[i].Nm = in[i].Nmeasure; 172 out[i].Nn = in[i].Nmissing; 173 out[i].offset = in[i].measureOffset; 174 out[i].missing = in[i].missingOffset; 175 176 // changed or added for PS1_V1 177 out[i].code = in[i].flags; 149 178 } 150 179 return (out); … … 164 193 out[i].Ncode = in[i].Ncode; 165 194 out[i].Nused = in[i].Nused; 195 196 // changed or added for PS1_V1 197 out[i].M_20 = 0; 198 out[i].M_80 = 0; 166 199 } 167 200 return (out); … … 218 251 out[i].fwhm_y = in[i].fwhm_y; 219 252 out[i].trate = in[i].trate; 220 out[i].code = in[i].code;221 253 out[i].ccdnum = in[i].ccdnum; 222 254 out[i].imageID = in[i].imageID; … … 237 269 out[i].Mxyyy = in[i].Mxyyy; 238 270 out[i].Myyyy = in[i].Myyyy; 271 272 // changed or added for PS1_DEV_2 273 out[i].externID = 0; 274 out[i].sourceID = 0; 275 276 // changed or added for PS1_V1 277 out[i].flags = in[i].code; 278 out[i].parentID = 0; 239 279 } 240 280 return (out); … … 275 315 out[i].fwhm_y = in[i].fwhm_y; 276 316 out[i].trate = in[i].trate; 277 out[i].code = in[i].code;278 317 out[i].ccdnum = in[i].ccdnum; 279 318 out[i].imageID = in[i].imageID; … … 294 333 out[i].Mxyyy = in[i].Mxyyy; 295 334 out[i].Myyyy = in[i].Myyyy; 335 336 // changed or added for PS1_V1 337 out[i].code = in[i].flags; 338 } 339 return (out); 340 } 341 342 PhotCode *PhotCode_PS1_DEV_1_To_Internal (PhotCode_PS1_DEV_1 *in, int Nvalues) { 343 344 int i; 345 PhotCode *out; 346 347 ALLOCATE (out, PhotCode, Nvalues); 348 349 for (i = 0; i < Nvalues; i++) { 350 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 351 out[i].name[31] = 0; // force termination 352 353 out[i].code = in[i].code; 354 out[i].type = in[i].type; 355 out[i].C = in[i].C; 356 out[i].dC = in[i].dC; 357 out[i].dX = in[i].dX; 358 out[i].K = in[i].K; 359 out[i].c1 = in[i].c1; 360 out[i].c2 = in[i].c2; 361 out[i].equiv = in[i].equiv; 362 out[i].Nc = in[i].Nc; 363 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 364 365 out[i].astromErrMagScale = in[i].astromErrMagScale; 366 out[i].photomErrSys = in[i].photomErrSys; 367 368 // changed or added for PS1_DEV_2 369 out[i].astromErrSys = 0.0; 370 out[i].astromErrScale = 0.0; 371 372 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 373 out[i].photomPoorMask = 0; 374 out[i].photomBadMask = 0; 375 out[i].astromPoorMask = 0; 376 out[i].astromBadMask = 0; 296 377 } 297 378 return (out); … … 323 404 out[i].astromErrMagScale = out[i].astromErrMagScale; 324 405 out[i].photomErrSys = out[i].photomErrSys; 325 326 } 327 return (out); 328 } 329 330 PhotCode *PhotCode_PS1_DEV_1_To_Internal (PhotCode_PS1_DEV_1 *in, int Nvalues) { 331 332 int i; 333 PhotCode *out; 334 335 ALLOCATE (out, PhotCode, Nvalues); 336 337 for (i = 0; i < Nvalues; i++) { 338 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 339 out[i].name[31] = 0; // force termination 340 341 out[i].code = in[i].code; 342 out[i].type = in[i].type; 343 out[i].C = in[i].C; 344 out[i].dC = in[i].dC; 345 out[i].dX = in[i].dX; 346 out[i].K = in[i].K; 347 out[i].c1 = in[i].c1; 348 out[i].c2 = in[i].c2; 349 out[i].equiv = in[i].equiv; 350 out[i].Nc = in[i].Nc; 351 352 // not defined in PS1_DEV_1 353 out[i].astromErrSys = 0.0; 354 out[i].astromErrScale = 0.0; 355 out[i].astromErrMagScale = in[i].astromErrMagScale; 356 out[i].photomErrSys = in[i].photomErrSys; 357 358 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 359 360 out[i].photomPoorMask = 0; 361 out[i].photomBadMask = 0; 362 out[i].astromPoorMask = 0; 363 out[i].astromBadMask = 0; 364 } 365 return (out); 366 } 406 } 407 return (out); 408 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r21408 r21418 29 29 out[i].detID = in[i].detID; 30 30 out[i].imageID = in[i].imageID; 31 out[i]. qPSF = in[i].qPSF;31 out[i].psfQual = in[i].psfQual; 32 32 out[i].psfChisq = in[i].psfChisq; 33 33 out[i].crNsigma = in[i].crNsigma; … … 40 40 out[i].dYccd = in[i].dYccd; 41 41 out[i].dbFlags = in[i].dbFlags; 42 out[i].photFlags = in[i].photFlags;43 42 out[i].stargal = in[i].stargal; 44 out[i].dophot = in[i].dophot; 43 44 // changed or added for PS1_V1 45 out[i].photFlags = in[i].photFlags | (in[i].dophot << 16); 46 out[i].t_msec = 0; 47 out[i].extID = 0; 48 out[i].Mxx = 0.0; 49 out[i].Mxy = 0.0; 50 out[i].Myy = 0.0; 51 out[i].dTccd = 0; 52 out[i].Map_small = 0; 45 53 } 46 54 return (out); … … 73 81 out[i].detID = in[i].detID; 74 82 out[i].imageID = in[i].imageID; 75 out[i]. qPSF = in[i].qPSF;83 out[i].psfQual = in[i].psfQual; 76 84 out[i].psfChisq = in[i].psfChisq; 77 85 out[i].crNsigma = in[i].crNsigma; … … 84 92 out[i].dYccd = in[i].dYccd; 85 93 out[i].dbFlags = in[i].dbFlags; 86 out[i].photFlags = in[i].photFlags;87 94 out[i].stargal = in[i].stargal; 88 out[i].dophot = in[i].dophot; 95 96 // changed or added for PS1_V1 97 out[i].photFlags = in[i].photFlags & 0x0000ffff; 98 out[i].dophot = in[i].photFlags >> 16; 89 99 } 90 100 return (out); … … 114 124 out[i].Nmissing = in[i].Nmissing; 115 125 out[i].Nextend = in[i].Nextend; 116 out[i].code = in[i].code;117 126 out[i].measureOffset = in[i].measureOffset; 118 127 out[i].missingOffset = in[i].missingOffset; … … 120 129 out[i].objID = in[i].objID; 121 130 out[i].catID = in[i].catID; 131 132 // changed or added for PS1_V1 133 out[i].flags = in[i].code; 134 out[i].ChiSq = 0.0; 135 out[i].Npos = 0.0; 136 out[i].extID = 0; 122 137 } 123 138 return (out); … … 147 162 out[i].Nmissing = in[i].Nmissing; 148 163 out[i].Nextend = in[i].Nextend; 149 out[i].code = in[i].code;150 164 out[i].measureOffset = in[i].measureOffset; 151 165 out[i].missingOffset = in[i].missingOffset; … … 153 167 out[i].objID = in[i].objID; 154 168 out[i].catID = in[i].catID; 169 170 // changed or added for PS1_V1 171 out[i].code = in[i].flags; 155 172 } 156 173 return (out); … … 170 187 out[i].Ncode = in[i].Ncode; 171 188 out[i].Nused = in[i].Nused; 189 190 // changed or added for PS1_V1 191 out[i].M_20 = 0; 192 out[i].M_80 = 0; 172 193 } 173 194 return (out); … … 201 222 memcpy (&out[i].coords, &in[i].coords, sizeof(Coords)); 202 223 203 strncpy (out[i].name, in[i].name, 63); // out[12 8], int[64]224 strncpy (out[i].name, in[i].name, 63); // out[121], int[64] 204 225 out[i].name[63] = 0; // force termination 205 226 … … 224 245 out[i].fwhm_y = in[i].fwhm_y; 225 246 out[i].trate = in[i].trate; 226 out[i].code = in[i].code;227 247 out[i].ccdnum = in[i].ccdnum; 228 248 out[i].imageID = in[i].imageID; … … 245 265 out[i].Mxyyy = in[i].Mxyyy; 246 266 out[i].Myyyy = in[i].Myyyy; 267 268 // changed or added for PS1_V1 269 out[i].flags = in[i].code; 270 out[i].parentID = 0; 247 271 } 248 272 return (out); … … 259 283 memcpy (&out[i].coords, &in[i].coords, sizeof(Coords)); 260 284 261 strncpy (out[i].name, in[i].name, 63); // in[12 8], out[64]285 strncpy (out[i].name, in[i].name, 63); // in[121], out[64] 262 286 out[i].name[63] = 0; // force termination 263 287 … … 282 306 out[i].fwhm_y = in[i].fwhm_y; 283 307 out[i].trate = in[i].trate; 284 out[i].code = in[i].code;285 308 out[i].ccdnum = in[i].ccdnum; 286 309 out[i].imageID = in[i].imageID; … … 303 326 out[i].Mxyyy = in[i].Mxyyy; 304 327 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 308 309 PhotCode_PS1_DEV_2 *PhotCode_Internal_To_PS1_DEV_2 (PhotCode *in, int Nvalues) { 310 311 int i; 312 PhotCode_PS1_DEV_2 *out; 313 314 ALLOCATE (out, PhotCode_PS1_DEV_2, Nvalues); 328 329 // changed or added for PS1_V1 330 out[i].code = in[i].flags; 331 } 332 return (out); 333 } 334 335 PhotCode *PhotCode_PS1_DEV_2_To_Internal (PhotCode_PS1_DEV_2 *in, int Nvalues) { 336 337 int i; 338 PhotCode *out; 339 340 ALLOCATE (out, PhotCode, Nvalues); 315 341 316 342 for (i = 0; i < Nvalues; i++) { … … 334 360 out[i].astromErrMagScale = in[i].astromErrMagScale; 335 361 out[i].photomErrSys = in[i].photomErrSys; 336 } 337 return (out); 338 } 339 340 PhotCode *PhotCode_PS1_DEV_2_To_Internal (PhotCode_PS1_DEV_2 *in, int Nvalues) { 341 342 int i; 343 PhotCode *out; 344 345 ALLOCATE (out, PhotCode, Nvalues); 362 363 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 364 out[i].photomPoorMask = 0; 365 out[i].photomBadMask = 0; 366 out[i].astromPoorMask = 0; 367 out[i].astromBadMask = 0; 368 } 369 return (out); 370 } 371 372 PhotCode_PS1_DEV_2 *PhotCode_Internal_To_PS1_DEV_2 (PhotCode *in, int Nvalues) { 373 374 int i; 375 PhotCode_PS1_DEV_2 *out; 376 377 ALLOCATE (out, PhotCode_PS1_DEV_2, Nvalues); 346 378 347 379 for (i = 0; i < Nvalues; i++) { … … 365 397 out[i].astromErrMagScale = in[i].astromErrMagScale; 366 398 out[i].photomErrSys = in[i].photomErrSys; 367 368 out[i].photomPoorMask = 0; 369 out[i].photomBadMask = 0; 370 out[i].astromPoorMask = 0; 371 out[i].astromBadMask = 0; 372 } 373 return (out); 374 } 399 } 400 return (out); 401 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
r21408 r21418 3 3 /* convert PS1_DEV_3 formats to internal formats */ 4 4 5 // XXX EAM I am not yet ready to commit to a full PS1_DEV_3 release, but I am providingimage and photcode conversion5 // We only provide image and photcode conversion 6 6 7 7 Image *Image_PS1_DEV_3_ToInternal (Image_PS1_DEV_3 *in, int Nvalues) { … … 38 38 out[i].fwhm_y = in[i].fwhm_y; 39 39 out[i].trate = in[i].trate; 40 out[i].code = in[i].code;41 40 out[i].ccdnum = in[i].ccdnum; 42 41 out[i].imageID = in[i].imageID; … … 59 58 out[i].Mxyyy = in[i].Mxyyy; 60 59 out[i].Myyyy = in[i].Myyyy; 60 61 // changed or added for PS1_V1 62 out[i].flags = in[i].code; 63 out[i].parentID = 0; 61 64 } 62 65 return (out); … … 96 99 out[i].fwhm_y = in[i].fwhm_y; 97 100 out[i].trate = in[i].trate; 98 out[i].code = in[i].code;99 101 out[i].ccdnum = in[i].ccdnum; 100 102 out[i].imageID = in[i].imageID; … … 117 119 out[i].Mxyyy = in[i].Mxyyy; 118 120 out[i].Myyyy = in[i].Myyyy; 121 122 // changed or added for PS1_V1 123 out[i].code = in[i].flags; 124 } 125 return (out); 126 } 127 128 PhotCode *PhotCode_PS1_DEV_3_To_Internal (PhotCode_PS1_DEV_3 *in, int Nvalues) { 129 130 int i; 131 PhotCode *out; 132 133 ALLOCATE (out, PhotCode, Nvalues); 134 135 for (i = 0; i < Nvalues; i++) { 136 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 137 out[i].name[31] = 0; // force termination 138 139 out[i].code = in[i].code; 140 out[i].type = in[i].type; 141 out[i].C = in[i].C; 142 out[i].dC = in[i].dC; 143 out[i].dX = in[i].dX; 144 out[i].K = in[i].K; 145 out[i].c1 = in[i].c1; 146 out[i].c2 = in[i].c2; 147 out[i].equiv = in[i].equiv; 148 out[i].Nc = in[i].Nc; 149 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 150 151 out[i].astromErrSys = in[i].astromErrSys; 152 out[i].astromErrScale = in[i].astromErrScale; 153 out[i].astromErrMagScale = in[i].astromErrMagScale; 154 out[i].photomErrSys = in[i].photomErrSys; 155 156 out[i].photomPoorMask = in[i].photomPoorMask; 157 out[i].photomBadMask = in[i].photomBadMask; 158 out[i].astromPoorMask = in[i].astromPoorMask; 159 out[i].astromBadMask = in[i].astromBadMask; 119 160 } 120 161 return (out); … … 157 198 } 158 199 159 PhotCode *PhotCode_PS1_DEV_3_To_Internal (PhotCode_PS1_DEV_3 *in, int Nvalues) {160 161 int i;162 PhotCode *out;163 164 ALLOCATE (out, PhotCode, Nvalues);165 166 for (i = 0; i < Nvalues; i++) {167 strncpy (out[i].name, in[i].name, 31); // out[32], in[32]168 out[i].name[31] = 0; // force termination169 170 out[i].code = in[i].code;171 out[i].type = in[i].type;172 out[i].C = in[i].C;173 out[i].dC = in[i].dC;174 out[i].dX = in[i].dX;175 out[i].K = in[i].K;176 out[i].c1 = in[i].c1;177 out[i].c2 = in[i].c2;178 out[i].equiv = in[i].equiv;179 out[i].Nc = in[i].Nc;180 memcpy (out[i].X, in[i].X, 4*sizeof(float));181 182 out[i].astromErrSys = in[i].astromErrSys;183 out[i].astromErrScale = in[i].astromErrScale;184 out[i].astromErrMagScale = in[i].astromErrMagScale;185 out[i].photomErrSys = in[i].photomErrSys;186 187 out[i].photomPoorMask = in[i].photomPoorMask;188 out[i].photomBadMask = in[i].photomBadMask;189 out[i].astromPoorMask = in[i].astromPoorMask;190 out[i].astromBadMask = in[i].astromBadMask;191 }192 return (out);193 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_elixir.c
r21408 r21418 10 10 11 11 for (i = 0; i < Nvalues; i++) { 12 out[i].FWx = in[i].FWx; 13 out[i].t = in[i].t; 14 out[i].averef = in[i].averef; 15 16 // changed for PANSTARRS_DEV_0 12 17 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 13 18 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; … … 16 21 out[i].dt = (in[i].dt == NAN_S_SHORT) ? NAN : in[i].dt * 0.001; 17 22 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 18 19 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture20 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags21 23 out[i].Map = (in[i].Mgal == NAN_S_SHORT) ? NAN : in[i].Mgal * 0.001; 22 24 out[i].airmass = (in[i].airmass == NAN_S_SHORT) ? NAN : in[i].airmass* 0.001; 23 out[i].FWx = in[i].FWx;24 25 out[i].FWy = in[i].fwy * in[i].FWx * 0.01; 25 26 out[i].theta = in[i].theta*(0x10000 / 0x100); 26 out[i].dophot = in[i].dophot;27 27 out[i].photcode = in[i].source; 28 out[i].t = in[i].t;29 out[i].averef = in[i].averef;30 out[i].dbFlags = in[i].flags;31 28 32 /* these can be determined if needed / desired */ 33 out[i].Xccd = 0; 34 out[i].Yccd = 0; 35 out[i].dXccd = 0; 36 out[i].dYccd = 0; 37 38 /* these do not have a corresponding value */ 29 // added for PANSTARRS_DEV_0 30 out[i].Xccd = 0; // determine on-the-fly 31 out[i].Yccd = 0; // determine on-the-fly 32 out[i].dXccd = 0; 33 out[i].dYccd = 0; 39 34 out[i].az = 0; 40 35 out[i].stargal = 0; 41 36 out[i].Sky = 0; 42 37 out[i].dSky = 0; 43 out[i]. qPSF= 0;38 out[i].psfQual = 0; 44 39 out[i].psfChisq = 0; 45 40 out[i].crNsigma = 0; 46 41 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 48 49 /* XXX add these later */ 50 out[i].detID = 0; 51 out[i].imageID = 0; 42 out[i].detID = 0; // determine on-the-fly 43 out[i].imageID = 0; // determine on-the-fly 44 45 // changed or added for PS1_DEV_1 (2008.02.26) 46 out[i].dbFlags = in[i].flags; 47 out[i].detID = 0; 48 out[i].imageID = 0; 49 50 // changed or added for PS1_DEV_2 51 out[i].Map = in[i].Mgal; 52 out[i].dMcal = 0; 53 54 // changed or added for PS1_V1 55 out[i].photFlags = in[i].dophot << 16; 56 out[i].t_msec = 0; 57 out[i].extID = 0; 58 out[i].Mxx = 0.0; 59 out[i].Mxy = 0.0; 60 out[i].Myy = 0.0; 61 out[i].dTccd = 0; 62 out[i].Map_small = 0; 52 63 } 53 64 return (out); … … 63 74 64 75 for (i = 0; i < Nvalues; i++) { 76 out[i].FWx = in[i].FWx; 77 out[i].t = in[i].t; 78 out[i].averef = in[i].averef; 79 80 // changed for PANSTARRS_DEV_0 65 81 out[i].dR = isnan(in[i].dR ) ? NAN_S_SHORT : in[i].dR * 100.0; 66 82 out[i].dD = isnan(in[i].dD ) ? NAN_S_SHORT : in[i].dD * 100.0; … … 71 87 out[i].Mgal = isnan(in[i].Map ) ? NAN_S_SHORT : in[i].Map * 1000.0; 72 88 out[i].airmass = isnan(in[i].airmass) ? NAN_S_SHORT : in[i].airmass * 1000.0; 89 out[i].fwy = in[i].FWy * 100.0 / in[i].FWx; 90 out[i].theta = in[i].theta*(0x100/ 0x10000); 91 out[i].source = in[i].photcode; 73 92 74 93 if (out[i].M < 0) { … … 76 95 } 77 96 78 out[i].FWx = in[i].FWx; 79 out[i].fwy = in[i].FWy * 100.0 / in[i].FWx; 80 out[i].theta = in[i].theta*(0x100/ 0x10000); 81 out[i].dophot = in[i].dophot; 82 out[i].source = in[i].photcode; 83 out[i].t = in[i].t; 84 out[i].averef = in[i].averef; 97 // changed or added for PS1_DEV_1 (2008.02.26) 85 98 out[i].flags = in[i].dbFlags; 99 100 // changed or added for PS1_V1 101 out[i].dophot = in[i].photFlags >> 16; 86 102 } 87 103 return (out); … … 101 117 out[i].D = in[i].D; 102 118 out[i].Xp = in[i].Xp; 103 out[i].Nmeasure = in[i].Nm; 104 out[i].Nmissing = in[i].Nn; 105 out[i].code = in[i].code; 106 out[i].measureOffset = in[i].offset; 107 out[i].missingOffset = in[i].missing; 108 109 /* these don't exist in Elixir */ 119 120 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 121 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 122 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 123 primary[0][i].Xm = in[i].Xm; 124 125 primary[0][i].Ncode = 0; 126 primary[0][i].Nused = 0; 127 128 // added for PANSTARRS_DEV_0 110 129 out[i].dR = 0; 111 130 out[i].dD = 0; … … 116 135 out[i].P = 0; 117 136 out[i].dP = 0; 118 119 /* XXX add these later */ 120 out[i].objID = 0; 121 out[i].catID = 0; 122 123 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 124 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 125 primary[0][i].Xm = in[i].Xm; 126 primary[0][i].Ncode = 0; 127 primary[0][i].Nused = 0; 137 out[i].objID = 0; // determine on-the-fly 138 out[i].catID = 0; // determine on-the-fly 139 140 // changed or added for PS1_DEV_2 141 out[i].Nmeasure = in[i].Nm; 142 out[i].Nmissing = in[i].Nn; 143 out[i].measureOffset = in[i].offset; 144 out[i].missingOffset = in[i].missing; 145 out[i].Nextend = 0; 146 out[i].extendOffset = 0; 147 148 // changed or added for PS1_V1 149 out[i].flags = in[i].code; 150 out[i].ChiSq = 0.0; 151 out[i].Npos = 0.0; 152 out[i].extID = 0; 128 153 } 129 154 return (out); … … 142 167 out[i].D = in[i].D; 143 168 out[i].Xp = in[i].Xp; 144 out[i].Nm = in[i].Nmeasure; 145 out[i].Nn = in[i].Nmissing; 146 out[i].code = in[i].code; 147 out[i].offset = in[i].measureOffset; 148 out[i].missing = in[i].missingOffset; 149 169 170 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 150 171 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 151 172 out[i].dM = isnan(primary[i].dM) ? NAN_S_SHORT : primary[i].dM * 1000.0; 152 173 out[i].Xm = primary[i].Xm; 174 175 // changed or added for PS1_DEV_2 176 out[i].Nm = in[i].Nmeasure; 177 out[i].Nn = in[i].Nmissing; 178 out[i].offset = in[i].measureOffset; 179 out[i].missing = in[i].missingOffset; 180 181 // changed or added for PS1_V1 182 out[i].code = in[i].flags; 153 183 } 154 184 return (out); … … 164 194 165 195 for (i = 0; i < Nvalues; i++) { 196 out[i].Xm = in[i].Xm; 197 198 // added or changed for PANSTARRS_DEV_0 166 199 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 167 200 out[i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 168 out[i].Xm = in[i].Xm;169 201 out[i].Ncode = 0; 170 202 out[i].Nused = 0; 203 204 // changed or added for PS1_V1 205 out[i].M_20 = 0; 206 out[i].M_80 = 0; 171 207 } 172 208 return (out); … … 182 218 183 219 for (i = 0; i < Nvalues; i++) { 220 out[i].Xm = in[i].Xm; 221 222 // added or changed for PANSTARRS_DEV_0 184 223 out[i].M = isnan(in[i].M) ? NAN_S_SHORT : in[i].M * 1000.0; 185 224 out[i].dM = isnan(in[i].dM) ? NAN_S_SHORT : in[i].dM * 1000.0; 186 out[i].Xm = in[i].Xm;187 225 } 188 226 return (out); … … 207 245 out[i].NX = in[i].NX; 208 246 out[i].NY = in[i].NY; 209 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001;210 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001;211 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;212 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001;213 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001;214 247 out[i].Xm = in[i].Xm; 215 248 out[i].photcode = in[i].source; … … 221 254 out[i].fwhm_y = in[i].fwhm_y; 222 255 out[i].trate = in[i].trate; 223 out[i].code = in[i].code;224 256 out[i].ccdnum = in[i].ccdnum; 225 257 … … 240 272 out[i].Myyyy = in[i].Myyyy; 241 273 242 /* XXX add these later */ 243 out[i].imageID = 0; 244 245 // not available in ELIXIR 274 // added or changed for PANSTARRS_DEV_0 275 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001; 276 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001; 277 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001; 278 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 279 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001; 246 280 out[i].sidtime = NAN; 247 281 out[i].latitude = NAN; 282 out[i].imageID = 0; // determine on-the-fly 283 284 // changed or added for PS1_DEV_2 285 out[i].externID = 0; 286 out[i].sourceID = 0; 287 288 // changed or added for PS1_V1 289 out[i].flags = in[i].code; 290 out[i].parentID = 0; 248 291 } 249 292 return (out); … … 268 311 out[i].NX = in[i].NX; 269 312 out[i].NY = in[i].NY; 270 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 271 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 272 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 273 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 274 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 313 275 314 out[i].Xm = in[i].Xm; 276 315 out[i].source = in[i].photcode; … … 282 321 out[i].fwhm_y = in[i].fwhm_y; 283 322 out[i].trate = in[i].trate; 284 out[i].code = in[i].code;285 323 out[i].ccdnum = in[i].ccdnum; 286 324 … … 300 338 out[i].Mxyyy = in[i].Mxyyy; 301 339 out[i].Myyyy = in[i].Myyyy; 302 } 303 return (out); 304 } 305 306 PhotCode_Elixir *PhotCode_Internal_To_Elixir (PhotCode *in, int Nvalues) { 307 308 int i; 309 PhotCode_Elixir *out; 310 311 ALLOCATE (out, PhotCode_Elixir, Nvalues); 340 341 // added or changed for PANSTARRS_DEV_0 342 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 343 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 344 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 345 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 346 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 347 348 // changed or added for PS1_V1 349 out[i].code = in[i].flags; 350 } 351 return (out); 352 } 353 354 PhotCode *PhotCode_Elixir_To_Internal (PhotCode_Elixir *in, int Nvalues) { 355 356 int i; 357 PhotCode *out; 358 359 ALLOCATE (out, PhotCode, Nvalues); 312 360 313 361 for (i = 0; i < Nvalues; i++) { … … 326 374 out[i].Nc = in[i].Nc; 327 375 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 328 } 329 return (out); 330 } 331 332 PhotCode *PhotCode_Elixir_To_Internal (PhotCode_Elixir *in, int Nvalues) { 333 334 int i; 335 PhotCode *out; 336 337 ALLOCATE (out, PhotCode, Nvalues); 376 377 // changed or added for PS1_DEV_1 378 out[i].astromErrMagScale = 0.0; 379 out[i].photomErrSys = 0.0; 380 381 // changed or added for PS1_DEV_2 382 out[i].astromErrSys = 0.0; 383 out[i].astromErrScale = 0.0; 384 385 // changed or added for PS1_V1 (also PS1_DEV_3, deprecated) 386 out[i].photomPoorMask = 0; 387 out[i].photomBadMask = 0; 388 out[i].astromPoorMask = 0; 389 out[i].astromBadMask = 0; 390 } 391 return (out); 392 } 393 394 PhotCode_Elixir *PhotCode_Internal_To_Elixir (PhotCode *in, int Nvalues) { 395 396 int i; 397 PhotCode_Elixir *out; 398 399 ALLOCATE (out, PhotCode_Elixir, Nvalues); 338 400 339 401 for (i = 0; i < Nvalues; i++) { … … 352 414 out[i].Nc = in[i].Nc; 353 415 memcpy (out[i].X, in[i].X, 4*sizeof(float)); 354 355 // not defined in Elixir: 356 out[i].astromErrSys = 0.0; 357 out[i].astromErrScale = 0.0; 358 out[i].astromErrMagScale = 0.0; 359 out[i].photomErrSys = 0.0; 360 361 out[i].photomPoorMask = 0; 362 out[i].photomBadMask = 0; 363 out[i].astromPoorMask = 0; 364 out[i].astromBadMask = 0; 365 } 366 return (out); 367 } 416 } 417 return (out); 418 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_loneos.c
r21408 r21418 10 10 11 11 for (i = 0; i < Nvalues; i++) { 12 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 13 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; 14 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 15 out[i].dM = (in[i].dM == NAN_U_CHAR) ? NAN : in[i].dM * 0.001; 16 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 17 out[i].dophot = in[i].dophot; 18 out[i].photcode = in[i].source; 19 out[i].t = in[i].t; 20 21 /* flags and averef are now split */ 12 out[i].t = in[i].t; 13 14 // added or changed for ELIXIR 22 15 out[i].averef = in[i].averef & 0x00ffffff; 23 16 out[i].dbFlags = (in[i].averef & 0xff000000) >> 24; 24 25 /* these values don't exist in the Loneos format */ 26 27 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 28 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 29 out[i].Map = out[i].M; 17 out[i].t = in[i].t; 30 18 out[i].dt = 0; 31 19 out[i].airmass = 0; 20 out[i].FWy = 0; 21 out[i].FWx = 0; 22 out[i].theta = 0; 23 24 // changed for PANSTARRS_DEV_0 25 out[i].dR = (in[i].dR == NAN_S_SHORT) ? NAN : in[i].dR * 0.01; 26 out[i].dD = (in[i].dD == NAN_S_SHORT) ? NAN : in[i].dD * 0.01; 27 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 28 out[i].dM = (in[i].dM == NAN_U_CHAR) ? NAN : in[i].dM * 0.001; 29 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 30 out[i].Map = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 31 out[i].photcode = in[i].source; 32 33 // added for PANSTARRS_DEV_0 34 out[i].Xccd = 0; // determine on-the-fly 35 out[i].Yccd = 0; // determine on-the-fly 36 out[i].dXccd = 0; 37 out[i].dYccd = 0; 32 38 out[i].az = 0; 33 out[i].FWx = 0;34 out[i].FWy = 0;35 out[i].theta = 0;36 39 out[i].stargal = 0; 37 40 out[i].Sky = 0; 38 41 out[i].dSky = 0; 39 out[i]. qPSF= 0;42 out[i].psfQual = 0; 40 43 out[i].psfChisq = 0; 41 44 out[i].crNsigma = 0; 42 45 out[i].extNsigma = 0; 43 out[i].photFlags = 0; 44 45 /* these can be determined if needed / desired */ 46 out[i].Xccd = 0; 47 out[i].Yccd = 0; 48 out[i].dXccd = 0; 49 out[i].dYccd = 0; 50 51 /* XXX add these later */ 52 out[i].detID = 0; 53 out[i].imageID = 0; 46 out[i].detID = 0; // determine on-the-fly 47 out[i].imageID = 0; // determine on-the-fly 48 49 // changed or added for PS1_DEV_1 (2008.02.26) 50 out[i].detID = 0; 51 out[i].imageID = 0; 52 53 // changed or added for PS1_DEV_2 54 out[i].dMcal = 0; 55 56 // changed or added for PS1_V1 57 out[i].photFlags = in[i].dophot << 16; 58 out[i].t_msec = 0; 59 out[i].extID = 0; 60 out[i].Mxx = 0.0; 61 out[i].Mxy = 0.0; 62 out[i].Myy = 0.0; 63 out[i].dTccd = 0; 64 out[i].Map_small = 0; 54 65 } 55 66 return (out); … … 65 76 66 77 for (i = 0; i < Nvalues; i++) { 78 79 // changed for PANSTARRS_DEV_0 67 80 out[i].dR = isnan(in[i].dR ) ? NAN_S_SHORT : in[i].dR * 100.0; 68 81 out[i].dD = isnan(in[i].dD ) ? NAN_S_SHORT : in[i].dD * 100.0; … … 70 83 out[i].dM = isnan(in[i].dM ) ? NAN_U_CHAR : in[i].dM * 1000.0; 71 84 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 72 out[i].dophot = in[i].dophot;73 85 out[i].source = in[i].photcode; 74 86 out[i].t = in[i].t; … … 76 88 /* flags and averef are merged in Loneos */ 77 89 out[i].averef = (in[i].averef & 0x00ffffff) | (in[i].dbFlags << 24); 90 91 // changed or added for PS1_V1 92 out[i].dophot = in[i].photFlags >> 16; 78 93 } 79 94 return (out); … … 93 108 out[i].D = in[i].D; 94 109 out[i].Xp = in[i].Xp; 95 out[i].Nmeasure = in[i].Nm; 96 out[i].Nmissing = in[i].Nn; 97 out[i].code = in[i].code; 98 out[i].measureOffset = in[i].offset; 99 out[i].missingOffset = in[i].missing; 100 101 /* these don't exist in Loneos */ 110 111 // added for ELIXIR 112 primary[0][i].dM = NAN; 113 114 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 115 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 116 primary[0][i].Xm = in[i].Xm; 117 primary[0][i].Ncode = 0; 118 primary[0][i].Nused = 0; 119 120 // added for PANSTARRS_DEV_0 102 121 out[i].dR = 0; 103 122 out[i].dD = 0; … … 108 127 out[i].P = 0; 109 128 out[i].dP = 0; 110 111 /* XXX add these later */ 112 out[i].objID = 0; 113 out[i].catID = 0; 114 115 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 116 primary[0][i].Xm = in[i].Xm; 117 primary[0][i].dM = NAN; 118 primary[0][i].Ncode = 0; 119 primary[0][i].Nused = 0; 129 out[i].objID = 0; // determine on-the-fly 130 out[i].catID = 0; // determine on-the-fly 131 132 // changed or added for PS1_DEV_2 133 out[i].Nmeasure = in[i].Nm; 134 out[i].Nmissing = in[i].Nn; 135 out[i].measureOffset = in[i].offset; 136 out[i].missingOffset = in[i].missing; 137 out[i].Nextend = 0; 138 out[i].extendOffset = 0; 139 140 // changed or added for PS1_V1 141 out[i].flags = in[i].code; 142 out[i].ChiSq = 0.0; 143 out[i].Npos = 0.0; 144 out[i].extID = 0; 120 145 } 121 146 return (out); … … 134 159 out[i].D = in[i].D; 135 160 out[i].Xp = in[i].Xp; 161 162 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 163 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 164 out[i].Xm = primary[i].Xm; 165 166 // changed or added for PS1_DEV_2 136 167 out[i].Nm = in[i].Nmeasure; 137 168 out[i].Nn = in[i].Nmissing; 138 out[i].code = in[i].code;139 169 out[i].offset = in[i].measureOffset; 140 170 out[i].missing = in[i].missingOffset; 141 171 142 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0;143 out[i]. Xm = primary[i].Xm;172 // changed or added for PS1_V1 173 out[i].code = in[i].flags; 144 174 } 145 175 return (out); … … 155 185 156 186 for (i = 0; i < Nvalues; i++) { 187 out[i].Xm = in[i].Xm; 188 189 // added for ELIXIR 190 out[i].dM = NAN; 191 192 // added or changed for PANSTARRS_DEV_0 157 193 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 158 out[i].Xm = in[i].Xm;159 out[i].dM = NAN;160 194 out[i].Ncode = 0; 161 195 out[i].Nused = 0; 196 197 // changed or added for PS1_V1 198 out[i].M_20 = 0; 199 out[i].M_80 = 0; 162 200 } 163 201 return (out); … … 173 211 174 212 for (i = 0; i < Nvalues; i++) { 213 out[i].Xm = in[i].Xm; 214 215 // added or changed for PANSTARRS_DEV_0 175 216 out[i].M = isnan(in[i].M) ? NAN_S_SHORT : in[i].M * 1000.0; 176 out[i].Xm = in[i].Xm;177 217 } 178 218 return (out); … … 197 237 out[i].NX = in[i].NX; 198 238 out[i].NY = in[i].NY; 199 200 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001;201 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001;202 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;203 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001;204 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001;205 239 206 240 out[i].Xm = in[i].Xm; … … 213 247 out[i].fwhm_y = in[i].fwhm_y; 214 248 out[i].trate = in[i].trate; 215 out[i].code = in[i].code;216 249 out[i].ccdnum = in[i].ccdnum; 250 217 251 out[i].order = in[i].order; 218 252 out[i].Mx = in[i].Mx; … … 231 265 out[i].Myyyy = in[i].Myyyy; 232 266 233 /* XXX add these later */ 234 out[i].imageID = 0; 267 // added or changed for PANSTARRS_DEV_0 268 out[i].secz = (in[i].secz == NAN_S_SHORT) ? NAN : in[i].secz * 0.001; 269 out[i].apmifit = (in[i].apmifit == NAN_S_SHORT) ? NAN : in[i].apmifit * 0.001; 270 out[i].dapmifit = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001; 271 out[i].Mcal = (in[i].Mcal == NAN_S_SHORT) ? NAN : in[i].Mcal * 0.001; 272 out[i].dMcal = (in[i].dMcal == NAN_S_SHORT) ? NAN : in[i].dMcal * 0.001; 273 out[i].sidtime = NAN; 274 out[i].latitude = NAN; 275 out[i].imageID = 0; // determine on-the-fly 276 277 // changed or added for PS1_DEV_2 278 out[i].externID = 0; 279 out[i].sourceID = 0; 280 281 // changed or added for PS1_V1 282 out[i].flags = in[i].code; 283 out[i].parentID = 0; 235 284 } 236 285 return (out); … … 255 304 out[i].NX = in[i].NX; 256 305 out[i].NY = in[i].NY; 257 258 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0;259 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0;260 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;261 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0;262 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0;263 306 264 307 out[i].Xm = in[i].Xm; … … 271 314 out[i].fwhm_y = in[i].fwhm_y; 272 315 out[i].trate = in[i].trate; 273 out[i].code = in[i].code;274 316 out[i].ccdnum = in[i].ccdnum; 317 275 318 out[i].order = in[i].order; 276 319 out[i].Mx = in[i].Mx; … … 288 331 out[i].Mxyyy = in[i].Mxyyy; 289 332 out[i].Myyyy = in[i].Myyyy; 290 } 291 return (out); 292 } 333 334 // added or changed for PANSTARRS_DEV_0 335 out[i].secz = isnan(in[i].secz ) ? NAN_S_SHORT : in[i].secz * 1000.0; 336 out[i].apmifit = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit * 1000.0; 337 out[i].dapmifit = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0; 338 out[i].Mcal = isnan(in[i].Mcal ) ? NAN_S_SHORT : in[i].Mcal * 1000.0; 339 out[i].dMcal = isnan(in[i].dMcal ) ? NAN_S_SHORT : in[i].dMcal * 1000.0; 340 341 // changed or added for PS1_V1 342 out[i].code = in[i].flags; 343 } 344 return (out); 345 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r21408 r21418 16 16 out[i].Mcal = in[i].Mcal; 17 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags20 out[i].Map = in[i].Mgal;21 18 out[i].airmass = in[i].airmass; 22 19 out[i].az = in[i].az; … … 25 22 out[i].FWy = in[i].FWy; 26 23 out[i].theta = in[i].theta; 27 out[i].dophot = in[i].dophot;28 24 out[i].photcode = in[i].photcode; 29 25 out[i].t = in[i].t; 30 26 out[i].averef = in[i].averef; 31 out[i].dbFlags = in[i].flags;32 27 out[i].Xccd = in[i].Xccd; 33 28 out[i].Yccd = in[i].Yccd; … … 37 32 out[i].Sky = in[i].Sky; 38 33 out[i].dSky = in[i].dSky; 39 out[i].qPSF = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF; 34 35 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 36 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 37 38 // changed or added for PS1_DEV_1 (2008.02.26) 39 out[i].psfQual = (in[i].psfQual == NAN_S_SHORT) ? NAN : in[i].psfQual; 40 out[i].dbFlags = in[i].flags; 40 41 out[i].detID = in[i].detID_lo; 41 42 out[i].imageID = in[i].imageID_lo; 42 43 // these don't have a correspondence 44 out[i].psfChisq = 0; 45 out[i].crNsigma = 0; 46 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 43 out[i].psfChisq = 0; 44 out[i].crNsigma = 0; 45 out[i].extNsigma = 0; 46 47 // changed or added for PS1_DEV_2 48 out[i].Map = in[i].Mgal; 49 out[i].dMcal = 0; 50 51 // changed or added for PS1_V1 52 out[i].photFlags = in[i].dophot << 16; 53 out[i].t_msec = 0; 54 out[i].extID = 0; 55 out[i].Mxx = 0.0; 56 out[i].Mxy = 0.0; 57 out[i].Myy = 0.0; 58 out[i].dTccd = 0; 59 out[i].Map_small = 0; 48 60 } 49 61 return (out); … … 64 76 out[i].dM = in[i].dM; 65 77 out[i].Mcal = in[i].Mcal; 66 out[i].Mgal = in[i].Map;67 78 out[i].airmass = in[i].airmass; 68 79 out[i].az = in[i].az; … … 71 82 out[i].FWy = in[i].FWy; 72 83 out[i].theta = in[i].theta; 73 out[i].dophot = in[i].dophot;74 84 out[i].photcode = in[i].photcode; 75 85 out[i].t = in[i].t; 76 86 out[i].averef = in[i].averef; 77 out[i].flags = in[i].dbFlags;78 87 out[i].Xccd = in[i].Xccd; 79 88 out[i].Yccd = in[i].Yccd; … … 83 92 out[i].Sky = in[i].Sky; 84 93 out[i].dSky = in[i].dSky; 85 out[i].qPSF = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF; 94 95 // changed or added for PS1_DEV_1 (2008.02.26) 96 out[i].flags = in[i].dbFlags; 97 out[i].psfQual = isnan(in[i].psfQual) ? NAN_S_SHORT : in[i].psfQual; 86 98 out[i].detID_hi = 0; 87 99 out[i].detID_lo = in[i].detID; 88 100 out[i].imageID_hi = 0; 89 101 out[i].imageID_lo = in[i].imageID; 102 103 // changed or added for PS1_DEV_2 104 out[i].Mgal = in[i].Map; 105 106 // changed or added for PS1_V1 107 // out[i].photFlags = in[i].photFlags & 0x0000ffff; (only dophot pre PS1_DEV_1) 108 out[i].dophot = in[i].photFlags >> 16; 90 109 } 91 110 return (out); … … 105 124 out[i].D = in[i].D; 106 125 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm;108 out[i].Nmissing = in[i].Nn;109 out[i].code = in[i].code;110 out[i].measureOffset = in[i].offset;111 out[i].missingOffset = in[i].missing;112 126 out[i].dR = in[i].dR; 113 127 out[i].dD = in[i].dD; … … 120 134 out[i].objID = in[i].objID; 121 135 out[i].catID = in[i].catID; 136 137 // changed or added for PS1_DEV_2 138 out[i].Nmeasure = in[i].Nm; 139 out[i].Nmissing = in[i].Nn; 140 out[i].measureOffset = in[i].offset; 141 out[i].missingOffset = in[i].missing; 142 out[i].Nextend = 0; 143 out[i].extendOffset = 0; 144 145 // changed or added for PS1_V1 146 out[i].flags = in[i].code; 147 out[i].ChiSq = 0.0; 148 out[i].Npos = 0.0; 149 out[i].extID = 0; 122 150 } 123 151 return (out); … … 137 165 out[i].D = in[i].D; 138 166 out[i].Xp = in[i].Xp; 139 out[i].Nm = in[i].Nmeasure;140 out[i].Nn = in[i].Nmissing;141 out[i].code = in[i].code;142 out[i].offset = in[i].measureOffset;143 out[i].missing = in[i].missingOffset;144 167 out[i].dR = in[i].dR; 145 168 out[i].dD = in[i].dD; … … 152 175 out[i].objID = in[i].objID; 153 176 out[i].catID = in[i].catID; 177 178 // changed or added for PS1_DEV_2 179 out[i].Nm = in[i].Nmeasure; 180 out[i].Nn = in[i].Nmissing; 181 out[i].offset = in[i].measureOffset; 182 out[i].missing = in[i].missingOffset; 183 184 // changed or added for PS1_V1 185 out[i].code = in[i].flags; 154 186 } 155 187 return (out); … … 170 202 out[i].Ncode = in[i].Ncode; 171 203 out[i].Nused = in[i].Nused; 204 205 // changed or added for PS1_V1 206 out[i].M_20 = 0; 207 out[i].M_80 = 0; 172 208 } 173 209 return (out); … … 226 262 out[i].fwhm_y = in[i].fwhm_y; 227 263 out[i].trate = in[i].trate; 228 out[i].code = in[i].code;229 264 out[i].ccdnum = in[i].ccdnum; 230 out[i].imageID = in[i].imageID_lo;231 265 232 266 out[i].order = in[i].order; … … 245 279 out[i].Mxyyy = in[i].Mxyyy; 246 280 out[i].Myyyy = in[i].Myyyy; 281 282 // changed or added for PS1_DEV_1 283 out[i].imageID = in[i].imageID_lo; 284 285 // changed or added for PS1_DEV_2 286 out[i].externID = 0; 287 out[i].sourceID = 0; 288 289 // changed or added for PS1_V1 290 out[i].flags = in[i].code; 291 out[i].parentID = 0; 247 292 } 248 293 return (out); … … 283 328 out[i].fwhm_y = in[i].fwhm_y; 284 329 out[i].trate = in[i].trate; 285 out[i].code = in[i].code;286 330 out[i].ccdnum = in[i].ccdnum; 287 out[i].imageID_hi = 0;288 out[i].imageID_lo = in[i].imageID;289 331 290 332 out[i].order = in[i].order; … … 303 345 out[i].Mxyyy = in[i].Mxyyy; 304 346 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 347 348 // changed or added for PS1_DEV_1 349 out[i].imageID_hi = 0; 350 out[i].imageID_lo = in[i].imageID; 351 352 // changed or added for PS1_V1 353 out[i].code = in[i].flags; 354 } 355 return (out); 356 } -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r21408 r21418 16 16 out[i].Mcal = in[i].Mcal; 17 17 18 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture19 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags20 out[i].Map = in[i].Mgal;21 18 out[i].airmass = in[i].airmass; 22 19 out[i].az = in[i].az; … … 25 22 out[i].FWy = in[i].FWy; 26 23 out[i].theta = in[i].theta; 27 out[i].dophot = in[i].dophot;28 24 out[i].photcode = in[i].photcode; 29 25 out[i].t = in[i].t; 30 26 out[i].averef = in[i].averef; 31 out[i].dbFlags = in[i].flags;32 27 out[i].Xccd = in[i].Xccd; 33 28 out[i].Yccd = in[i].Yccd; … … 37 32 out[i].Sky = in[i].Sky; 38 33 out[i].dSky = in[i].dSky; 39 out[i].qPSF = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF; 34 35 // 2008.02.26 : I've renamed Mgal to Map, and intend it to be used per aperture 36 // magnitudes. Most uses of Mgal in the past were actually aperture (isophotal) mags 37 38 // changed or added for PS1_DEV_1 (2008.02.26) 39 out[i].psfQual = (in[i].psfQual == NAN_S_SHORT) ? NAN : in[i].psfQual; 40 out[i].dbFlags = in[i].flags; 40 41 out[i].detID = in[i].detID_lo; 41 42 out[i].imageID = in[i].imageID_lo; 42 43 // these don't have a correspondence 44 out[i].psfChisq = 0; 45 out[i].crNsigma = 0; 46 out[i].extNsigma = 0; 47 out[i].photFlags = 0; 43 out[i].psfChisq = 0; 44 out[i].crNsigma = 0; 45 out[i].extNsigma = 0; 46 47 // changed or added for PS1_DEV_2 48 out[i].Map = in[i].Mgal; 49 out[i].dMcal = 0; 50 51 // changed or added for PS1_V1 52 out[i].photFlags = in[i].dophot << 16; 53 out[i].t_msec = 0; 54 out[i].extID = 0; 55 out[i].Mxx = 0.0; 56 out[i].Mxy = 0.0; 57 out[i].Myy = 0.0; 58 out[i].dTccd = 0; 59 out[i].Map_small = 0; 48 60 } 49 61 return (out); … … 64 76 out[i].dM = in[i].dM; 65 77 out[i].Mcal = in[i].Mcal; 66 out[i].Mgal = in[i].Map;67 78 out[i].airmass = in[i].airmass; 68 79 out[i].az = in[i].az; … … 71 82 out[i].FWy = in[i].FWy; 72 83 out[i].theta = in[i].theta; 73 out[i].dophot = in[i].dophot;74 84 out[i].photcode = in[i].photcode; 75 85 out[i].t = in[i].t; 76 86 out[i].averef = in[i].averef; 77 out[i].flags = in[i].dbFlags;78 87 out[i].Xccd = in[i].Xccd; 79 88 out[i].Yccd = in[i].Yccd; … … 83 92 out[i].Sky = in[i].Sky; 84 93 out[i].dSky = in[i].dSky; 85 out[i].qPSF = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF; 94 95 // changed or added for PS1_DEV_1 (2008.02.26) 96 out[i].flags = in[i].dbFlags; 97 out[i].psfQual = isnan(in[i].psfQual) ? NAN_S_SHORT : in[i].psfQual; 86 98 out[i].detID_hi = 0; 87 99 out[i].detID_lo = in[i].detID; 88 100 out[i].imageID_hi = 0; 89 101 out[i].imageID_lo = in[i].imageID; 102 103 // changed or added for PS1_DEV_2 104 out[i].Mgal = in[i].Map; 105 106 // changed or added for PS1_V1 107 // out[i].photFlags = in[i].photFlags & 0x0000ffff; (only dophot pre PS1_DEV_1) 108 out[i].dophot = in[i].photFlags >> 16; 90 109 } 91 110 return (out); … … 105 124 out[i].D = in[i].D; 106 125 out[i].Xp = in[i].Xp; 107 out[i].Nmeasure = in[i].Nm;108 out[i].Nmissing = in[i].Nn;109 out[i].code = in[i].code;110 out[i].measureOffset = in[i].offset;111 out[i].missingOffset = in[i].missing;112 126 out[i].dR = in[i].dR; 113 127 out[i].dD = in[i].dD; … … 120 134 out[i].objID = in[i].objID; 121 135 out[i].catID = in[i].catID; 136 137 // changed or added for PS1_DEV_2 138 out[i].Nmeasure = in[i].Nm; 139 out[i].Nmissing = in[i].Nn; 140 out[i].measureOffset = in[i].offset; 141 out[i].missingOffset = in[i].missing; 142 out[i].Nextend = 0; 143 out[i].extendOffset = 0; 144 145 // changed or added for PS1_V1 146 out[i].flags = in[i].code; 147 out[i].ChiSq = 0.0; 148 out[i].Npos = 0.0; 149 out[i].extID = 0; 122 150 } 123 151 return (out); … … 137 165 out[i].D = in[i].D; 138 166 out[i].Xp = in[i].Xp; 139 out[i].Nm = in[i].Nmeasure;140 out[i].Nn = in[i].Nmissing;141 out[i].code = in[i].code;142 out[i].offset = in[i].measureOffset;143 out[i].missing = in[i].missingOffset;144 167 out[i].dR = in[i].dR; 145 168 out[i].dD = in[i].dD; … … 152 175 out[i].objID = in[i].objID; 153 176 out[i].catID = in[i].catID; 177 178 // changed or added for PS1_DEV_2 179 out[i].Nm = in[i].Nmeasure; 180 out[i].Nn = in[i].Nmissing; 181 out[i].offset = in[i].measureOffset; 182 out[i].missing = in[i].missingOffset; 183 184 // changed or added for PS1_V1 185 out[i].code = in[i].flags; 154 186 } 155 187 return (out); … … 170 202 out[i].Ncode = in[i].Ncode; 171 203 out[i].Nused = in[i].Nused; 204 205 // changed or added for PS1_V1 206 out[i].M_20 = 0; 207 out[i].M_80 = 0; 172 208 } 173 209 return (out); … … 226 262 out[i].fwhm_y = in[i].fwhm_y; 227 263 out[i].trate = in[i].trate; 228 out[i].code = in[i].code;229 264 out[i].ccdnum = in[i].ccdnum; 230 out[i].imageID = in[i].imageID_lo;231 265 232 266 out[i].order = in[i].order; … … 245 279 out[i].Mxyyy = in[i].Mxyyy; 246 280 out[i].Myyyy = in[i].Myyyy; 281 282 // changed or added for PS1_DEV_1 283 out[i].imageID = in[i].imageID_lo; 284 285 // changed or added for PS1_DEV_2 286 out[i].externID = 0; 287 out[i].sourceID = 0; 288 289 // changed or added for PS1_V1 290 out[i].flags = in[i].code; 291 out[i].parentID = 0; 247 292 } 248 293 return (out); … … 283 328 out[i].fwhm_y = in[i].fwhm_y; 284 329 out[i].trate = in[i].trate; 285 out[i].code = in[i].code;286 330 out[i].ccdnum = in[i].ccdnum; 287 out[i].imageID_hi = 0;288 out[i].imageID_lo = in[i].imageID;289 331 290 332 out[i].order = in[i].order; … … 303 345 out[i].Mxyyy = in[i].Mxyyy; 304 346 out[i].Myyyy = in[i].Myyyy; 305 } 306 return (out); 307 } 347 348 // changed or added for PS1_DEV_1 349 out[i].imageID_hi = 0; 350 out[i].imageID_lo = in[i].imageID; 351 352 // changed or added for PS1_V1 353 out[i].code = in[i].flags; 354 } 355 return (out); 356 } 357 358 // XXX no photcode conversions? this may be from before we had a photcode FITS table... 359 -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_image.c
r21408 r21418 196 196 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_2"); 197 197 if (db[0].format == DVO_FORMAT_PS1_DEV_3) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_3"); 198 if (db[0].format == DVO_FORMAT_PS1_V1) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V1"); 198 199 199 200 return; -
branches/eam_branch_20090208/Ohana/src/libdvo/src/dvo_image_raw.c
r16810 r21418 54 54 if (db[0].format == DVO_FORMAT_PS1_DEV_1) ImageSize = sizeof(Image_PS1_DEV_1); 55 55 if (db[0].format == DVO_FORMAT_PS1_DEV_2) ImageSize = sizeof(Image_PS1_DEV_2); 56 if (db[0].format == DVO_FORMAT_PS1_DEV_3) ImageSize = sizeof(Image_PS1_DEV_3); 57 if (db[0].format == DVO_FORMAT_PS1_V1) ImageSize = sizeof(Image_PS1_V1); 56 58 57 59 /* check that filesize makes sense */ … … 78 80 if (db[0].format == DVO_FORMAT_PS1_DEV_1) gfits_table_mkheader_Image_PS1_DEV_1 (&db[0].theader); 79 81 if (db[0].format == DVO_FORMAT_PS1_DEV_2) gfits_table_mkheader_Image_PS1_DEV_2 (&db[0].theader); 82 if (db[0].format == DVO_FORMAT_PS1_DEV_3) gfits_table_mkheader_Image_PS1_DEV_3 (&db[0].theader); 83 if (db[0].format == DVO_FORMAT_PS1_V1) gfits_table_mkheader_Image_PS1_V1 (&db[0].theader); 80 84 81 85 /* read data from file */
Note:
See TracChangeset
for help on using the changeset viewer.
