Changeset 33281
- Timestamp:
- Feb 16, 2012, 6:27:18 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.parallel.dvo
r33276 r33281 98 98 mkstars 500 99 99 100 tapPLAN {((mjd_nc[]*4 + mjd_nc[]) + mjd_nc[]) / 3}100 tapPLAN {((mjd_nc[]*4 + mjd_nc[]) + mjd_nc[])} 101 101 102 102 # generate the basic images and check they were correctly ingested by dvo 103 103 mksequence $fileroot $catdir 104 for i 0 mjd_nc[] 3105 ckexposure catdir.testmjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw104 for i 0 mjd_nc[] 105 ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw 106 106 end 107 107 108 108 # run relphot on the db and check that the images now match the expected values 109 exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR catdir.test -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& tmp.log 110 for i 0 mjd_nc[] 3 111 ckexposure catdir.test mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot 109 exec relphot g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& tmp.log 110 111 for i 0 mjd_nc[] 112 # XXX this is a little ill-defined : if we run relphot with no tied down data, we should convert 113 # on a solution with zero points matching the mean zp of photometric data (hence the choice of element 114 # 1 in the zpt_nc[] array below. 115 ckexposure $catdir mjd_nc[$i] zpt_nc[1] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 116 # ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw 112 117 end 113 118 114 119 tapDONE 115 120 end 116 117 # go testdata/t1 catdir.test118 # ckexposure catdir.test mjd_uc[0] zpt_uc[0] raw : result is mean of 0.0 (since test corrects for ZPT_NOMINAL vs REAL)119 # ckexposure catdir.test mjd_nc[0] zpt_nc[0] raw : result is mean of 0.0120 # setphot -update -ubercal testzpt.fits -D CATDIR catdir.test121 # ckexposure catdir.test mjd_uc[0] zpt_uc[0] corr : result is mean of 0.0 (since image is corrected to ZPT_REAL)122 # ckexposure catdir.test mjd_nc[0] zpt_nc[0] corr : result is mean of -0.42 (since image is NOT corrected to ZPT_REAL)123 # relphot g -region 9.5 10.5 19.5 20.5 -update -D CATDIR catdir.test -D STAR_TOOFEW 1 -D SIGMA_LIM 0.075 -statmode MEAN124 # dvo: ckexposure catdir.test mjd_uc[0] zpt_uc[0] corr125 # mean is now -0.42126 # dvo: ckexposure catdir.test mjd_nc[0] zpt_nc[0] corr127 # mean is now -0.42128 # ** setphot assigned the zero point of the uc exposure to an effective -0.4 (ie, negative clouds), relphot was not told to keep this so it dragged the negative clouds to 0.0 -- this seems to be the right thing to do129 130 # re-run setphot, then relphot with -keep-ubercal131 132 # the test case has only 2 exposures, so the STAR_TOOFEW of 1 is necessary. Also, the mag and sigma distributions are somewhat artificial133 # relphot g -v -region 9.5 10.5 19.5 20.5 -D CATDIR catdir.test -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update134 # dvo: ckexposure catdir.test mjd_uc[0] zpt_uc[0] corr135 # mean is now 0.0136 # dvo: ckexposure catdir.test mjd_nc[0] zpt_nc[0] corr137 # mean is now 0.0138 # ** setphot correctly assigned the zero point of UC & relphot adjusted NC to match139 121 140 122 macro ckexposure … … 174 156 skyregion {$RA_CENTER - 0.2/dcos($DEC_CENTER)} {$RA_CENTER + 0.2/dcos($DEC_CENTER)} {$DEC_CENTER - 0.2} {$DEC_CENTER + 0.2} 175 157 mextract ra dec mag xccd yccd where (abs(time - $MJD_IMAGE) < 0.0001) 176 158 if (not(ra[])) 159 echo "no matching data for MJD = $MJD_IMAGE" 160 if ("$MODE" == "raw") 161 tapSKIP 4 162 else 163 tapSKIP 1 164 end 165 return 166 end 177 167 match2d -closest ra dec stars_ra stars_dec 0.001 -index1 index1 -index2 index2 178 168 … … 180 170 reindex stars_dec_m = stars_dec using index1 181 171 reindex stars_mag_m = stars_mag using index1 172 if (ra[] != stars_ra_m[]) 173 echo "failed to match stars in catdir to stars in memory" 174 break 175 end 182 176 set dr = 3600*(ra - stars_ra_m) 183 177 set dd = 3600*(dec - stars_dec_m) … … 185 179 186 180 if ($PLOT) 181 dev -n 0 182 cplot -pt 7 -c red ra dec 187 183 dev -n 1 188 184 lim mag dm; clear; box; plot mag dm … … 210 206 211 207 $ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0) 208 echo "$ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)" 212 209 213 210 if ("$MODE" == "raw") … … 219 216 set dm_adjust = dm$ix\$iy - $ZPT_NOMINAL + $ZPT_REAL_NORM 220 217 vstat -q dm_adjust 221 tapOK {abs($MEAN) < 0.005} "addstar raw ZP $MJD_IMAGE $FILTER "218 tapOK {abs($MEAN) < 0.005} "addstar raw ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 222 219 end 223 220 end … … 227 224 if ("$MODE" == "setphot_uc") 228 225 vstat -q dm 229 tapOK {abs($MEAN) < 0.005} "setphot_uc ZP $MJD_IMAGE $FILTER "226 tapOK {abs($MEAN) < 0.005} "setphot_uc ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 230 227 return 231 228 end … … 233 230 if ("$MODE" == "setphot_nc") 234 231 vstat -q dm 235 tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "setphot_nc ZP $MJD_IMAGE $FILTER "232 tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "setphot_nc ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 236 233 return 237 234 end … … 239 236 if ("$MODE" == "relphot_nc") 240 237 vstat -q dm 241 tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "setphot_nc ZP $MJD_IMAGE $FILTER "238 tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "setphot_nc ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 242 239 return 243 240 end … … 245 242 if ("$MODE" == "relphot") 246 243 vstat -q dm 247 tapOK {abs($MEAN) < 0.005} "relphot ZP $MJD_IMAGE $FILTER "244 tapOK {abs($MEAN) < 0.005} "relphot ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 248 245 return 249 246 end … … 257 254 end 258 255 259 local i 260 256 local i T1 T2 257 258 ctimes -abs now -var T1 261 259 # we have a second set of mjd and zero point values for non-ubercal'ed images 262 # for i 0 mjd_nc[] 263 for i 0 mjd_nc[] 3 260 for i 0 mjd_nc[] 264 261 mkexposure $1.nc.$i $RA_CENTER $DEC_CENTER zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] mjd_nc[$i] $filt_nc:$i $2 265 262 end 263 ctimes -abs now -var T2 264 echo "elapsed: {86400*($T2 - $T1)}" 266 265 end 267 266 … … 294 293 $dec = $DECo - $dy / 3600.0 295 294 # echo $ra $dec $dx $dy 295 echo mkinput test.in.txt $ra $dec $ZPT 296 296 mkinput test.in.txt $ra $dec $ZPT 297 # costs 7/36 sec / chip 297 298 298 299 # ra,dec is the center of this chip … … 310 311 exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options 311 312 echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options 312 313 # costs 8/36 sec / chip 314 313 315 # the fake images have inconsistent ra,dec and airmass,sidtime values 314 316 echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass 315 exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass >& tmp.log 317 exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass >& /dev/null 318 # costs 10/36 sec / chip 316 319 end 317 320 end … … 342 345 set cell_y = int(stars_y / ($CHIP_DX / $NCELL_X)) 343 346 344 # eddie says: M_real = M_inst + zpt + ff_offset 345 # thus, stars_mi = stars_mag - zpt - ff_offset = stars_m - offset 346 set stars_mi = zero(stars_m) 347 for i 0 stars_mi[] 348 $nx = cell_x[$i] 349 $ny = cell_y[$i] 350 $offset = 0.0 351 stars_mi[$i] = stars_m[$i] - $offset 352 end 353 347 if (1) 348 # FLAT-FIELD CORRECTION 349 # eddie says: M_real = M_inst + zpt + ff_offset 350 # thus, stars_mi = stars_mag - zpt - ff_offset = stars_m - offset 351 set stars_mi = zero(stars_m) 352 for i 0 stars_mi[] 353 $nx = cell_x[$i] 354 $ny = cell_y[$i] 355 # $offset = cell_off[$nx][$ny] 356 $offset = 0.0 357 stars_mi[$i] = stars_m[$i] - $offset 358 end 359 else 360 set stars_mi = stars_m 361 end 362 363 # delete the output file before writing 364 exec rm -f $1 354 365 write -f "%10.6f %10.6f %7.3f %6.1f %6.1f %7.3f" $1 stars_r stars_d stars_mr stars_x stars_y stars_mi 355 366 end
Note:
See TracChangeset
for help on using the changeset viewer.
