Changeset 33288
- Timestamp:
- Feb 16, 2012, 3:24:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.parallel.dvo
r33281 r33288 11 11 # set various global variables 12 12 macro init 13 echo "starting init..." 13 14 $RA_CENTER = 10.0 14 15 $DEC_CENTER = 20.0 … … 22 23 $CHIP_DX = 1000 23 24 $CHIP_DY = 1000 25 if (not($?VERBOSE)) set VERBOSE = 0 24 26 25 27 # images are loaded into dvo with GPC1 photcodes, so we need to get the nominal zps for those filters … … 44 46 # mjd and zpt values for not-ubercal'ed images 45 47 $filt_nc:n = 9 46 $filt_nc:0 = g 47 $filt_nc:1 = g 48 $filt_nc:2 = g 49 $filt_nc:3 = r 50 $filt_nc:4 = r 51 $filt_nc:5 = r 52 $filt_nc:6 = i 53 $filt_nc:7 = i 54 $filt_nc:8 = i 48 create filtN_nc 0 $filt_nc:n 49 $filt_nc:0 = g; filtN_nc[0] = 1 50 $filt_nc:1 = g; filtN_nc[1] = 1 51 $filt_nc:2 = g; filtN_nc[2] = 1 52 $filt_nc:3 = r; filtN_nc[3] = 2 53 $filt_nc:4 = r; filtN_nc[4] = 2 54 $filt_nc:5 = r; filtN_nc[5] = 2 55 $filt_nc:6 = i; filtN_nc[6] = 3 56 $filt_nc:7 = i; filtN_nc[7] = 3 57 $filt_nc:8 = i; filtN_nc[8] = 3 55 58 56 59 # airmass slopes for these sequnece … … 66 69 # ubercal zero points are defined as ZP_nominal + 2.5log(exptime) + K*(airmass - 1.0) 67 70 set zpt_nc = 25.0 + 2.5*log(exptime_nc) + klam_nc*(airmass_nc - 1.0) - tmpseq*0.0050 + 0.0025 71 72 # without an ubercal or other tie, relphot should set zpts to the mean of the zpts for a filter 73 subset tmp = zpt_nc where filtN_nc == 1; vstat -q tmp; set zpt_nc_g = $MEAN 74 subset tmp = zpt_nc where filtN_nc == 2; vstat -q tmp; set zpt_nc_r = $MEAN 75 subset tmp = zpt_nc where filtN_nc == 3; vstat -q tmp; set zpt_nc_i = $MEAN 68 76 69 77 set mjd_nc = zero(zpt_nc) … … 106 114 end 107 115 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 -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 116 # parallel-ize the database 117 mkparallel $catdir 118 119 # run relphot on the serial db and check that the images now match the expected values 120 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 >& log.relphot.s0 110 121 111 122 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 123 # this is a little ill-defined : if we run relphot with no tied 124 # down data, we should convert on a solution with zero points 125 # matching the mean zp of photometric data, which we calculate in 126 # 'init' 127 ckexposure $catdir mjd_nc[$i] $zpt_nc_$filt_nc:$i exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 128 end 129 130 # run relphot on the parallel db and check that the images now match the expected values 131 exec relphot -parallel-serial g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir.p0 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& log.relphot.p0 132 133 for i 0 mjd_nc[] 134 # this is a little ill-defined : if we run relphot with no tied 135 # down data, we should convert on a solution with zero points 136 # matching the mean zp of photometric data, which we calculate in 137 # 'init' 138 ckexposure $catdir.p0 mjd_nc[$i] $zpt_nc_$filt_nc:$i exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 117 139 end 118 140 … … 206 228 207 229 $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)"230 if ($VERBOSE) echo "$ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)" 209 231 210 232 if ("$MODE" == "raw") … … 236 258 if ("$MODE" == "relphot_nc") 237 259 vstat -q dm 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)}"260 tapOK {abs($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM) < 0.005} "relphot_nc ZP $MJD_IMAGE $FILTER : $MEAN $ZPT_NOMINAL $ZPT_REAL_NORM {($MEAN - $ZPT_NOMINAL + $ZPT_REAL_NORM)}" 239 261 return 240 262 end … … 254 276 end 255 277 278 echo "starting mksequence..." 256 279 local i T1 T2 257 280 … … 259 282 # we have a second set of mjd and zero point values for non-ubercal'ed images 260 283 for i 0 mjd_nc[] 284 echo -no-return "$i.. " 261 285 mkexposure $1.nc.$i $RA_CENTER $DEC_CENTER zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] mjd_nc[$i] $filt_nc:$i $2 262 286 end 263 287 ctimes -abs now -var T2 264 echo " elapsed: {86400*($T2 - $T1)}"288 echo "done ({86400*($T2 - $T1)} sec)" 265 289 end 266 290 … … 293 317 $dec = $DECo - $dy / 3600.0 294 318 # echo $ra $dec $dx $dy 295 echo mkinput test.in.txt $ra $dec $ZPT319 if ($VERBOSE) echo mkinput test.in.txt $ra $dec $ZPT 296 320 mkinput test.in.txt $ra $dec $ZPT 297 321 # costs 7/36 sec / chip … … 309 333 $options = $options -airmass $AIRMASS 310 334 $options = $options -exptime $EXPTIME 335 if ($VERBOSE) echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options 311 336 exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options 312 echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options313 337 # costs 8/36 sec / chip 314 338 315 339 # the fake images have inconsistent ra,dec and airmass,sidtime values 316 echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass340 if ($VERBOSE) echo addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass 317 341 exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass >& /dev/null 318 342 # costs 10/36 sec / chip … … 373 397 end 374 398 399 echo "starting mkstars..." 375 400 local RA_RANGE DEC_RANGE 376 401 … … 387 412 end 388 413 389 # create a populated catdir with a couple of cmf files 390 macro test.relphot 391 if ($0 != 3) 392 echo "test.relphot (cmftype) (dvotype)" 393 break 394 end 395 396 tapPLAN 4 397 398 exec rm -rf catdir.test 399 400 $RA = 10.0 401 $DEC = 20.0 402 403 for i 0 $offset:n 404 mkinput test.in.txt $offset:$i 405 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 406 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 407 end 408 409 exec relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 >& /dev/null 410 411 catdir catdir.test 412 skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 413 414 imextract time Mcal 415 416 for i 0 $offset:n 417 tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i" 418 end 419 420 exec rm test.cmf test.in.txt 421 exec rm -r catdir.test 422 423 tapDONE 424 end 425 426 # running setphot: setphot testzpt.fits -update -ubercal -D CATDIR catdir.test 414 # copy the catdir to catdir.p0 and parallelize to local directories catdir.d1 - catdir.d3 415 macro mkparallel 416 if ($0 != 2) 417 echo "USAGE: mkparallel (catdir)" 418 break 419 end 420 421 local hostname catdir 422 423 $hostname = `hostname -s` 424 425 $tmp1 = `dirname $1` 426 $tmp2 = `basename $1` 427 $catdir = $tmp1/$tmp2 428 429 exec rsync -auv $catdir/ $catdir.p0/ 430 mkdir $catdir.d1 431 mkdir $catdir.d2 432 mkdir $catdir.d3 433 434 exec rm -f $catdir.p0/HostTable.dat 435 exec echo "1 $hostname $catdir.d1" > $catdir.p0/HostTable.dat 436 exec echo "2 $hostname $catdir.d2" >> $catdir.p0/HostTable.dat 437 exec echo "3 $hostname $catdir.d3" >> $catdir.p0/HostTable.dat 438 439 exec dvodist -out $catdir.p0 440 end 441
Note:
See TracChangeset
for help on using the changeset viewer.
