Changeset 33143
- Timestamp:
- Jan 24, 2012, 5:32:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.flatcorr.dvo
r33139 r33143 29 29 $CHIP_DX = 1000 30 30 $CHIP_DY = 1000 31 end 32 33 # create a populated catdir with a couple of cmf files 34 macro test.relphot 35 if ($0 != 3) 36 echo "test.relphot (cmftype) (dvotype)" 37 break 38 end 39 40 tapPLAN 4 41 42 exec rm -rf catdir.test 43 44 $RA = 10.0 45 $DEC = 20.0 46 47 for i 0 $offset:n 48 mkinput test.in.txt $offset:$i 49 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 50 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 51 end 52 53 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 54 55 catdir catdir.test 56 skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 57 58 imextract time Mcal 59 60 for i 0 $offset:n 61 tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i" 62 end 63 64 exec rm test.cmf test.in.txt 65 exec rm -r catdir.test 66 67 tapDONE 31 32 # we have two sets of images: ubercaled and not-ubercaled 33 34 # mjd and zpt values for ubercal'ed imaged 35 create tmpseq 0 9 36 37 set zpt_uc = 25.0 + tmpseq*0.0050 - 0.0025 38 set mjd_uc = zero(zpt_uc) 39 mjd_uc[0] = 55000.01 40 mjd_uc[1] = 55000.02 41 mjd_uc[2] = 55000.03 42 43 mjd_uc[3] = 55015.01 44 mjd_uc[4] = 55015.02 45 mjd_uc[5] = 55015.03 46 47 mjd_uc[6] = 55025.01 48 mjd_uc[7] = 55025.02 49 mjd_uc[8] = 55025.03 50 51 # mjd and zpt values for not-ubercal'ed images 52 set zpt_nc = 25.0 - tmpseq*0.0050 + 0.0025 53 set mjd_nc = zero(zpt_nc) 54 mjd_nc[0] = 55100.01 55 mjd_nc[1] = 55100.02 56 mjd_nc[2] = 55100.03 57 58 mjd_nc[3] = 55115.01 59 mjd_nc[4] = 55115.02 60 mjd_nc[5] = 55115.03 61 62 mjd_nc[6] = 55125.01 63 mjd_nc[7] = 55125.02 64 mjd_nc[8] = 55125.03 68 65 end 69 66 … … 74 71 end 75 72 76 exec rm -rf $2 73 local fileroot rootdir catdir 74 75 $fileroot = $1 76 $catdir = $2 77 78 dirname $1 -var rootdir 79 mkdir $rootdir 80 81 exec rm -rf $catdir 77 82 78 83 init … … 80 85 mkstars 500 81 86 82 mkdir testdata 83 mksequence $1 $2 87 mksequence $fileroot $catdir 84 88 end 85 89 86 90 macro ckexposure 87 if ($0 != 3) 88 echo "ckexposure (catdir) (zpt)" 91 if ($0 != 4) 92 echo "ckexposure (catdir) (zpt) (mode)" 93 echo " mode == raw or corr" 89 94 break 90 95 end … … 120 125 subset dm11 = dm if (cell_xbin == 1) && (cell_ybin == 1) 121 126 122 # mag_DVO = m_inst + zpt_nominal 123 # mag_real = m_inst + zpt_real + cell_offset 124 # dm = mag_DVO - mag_real = zpt_nominal - zpt_real - cell_offset 125 # <dm> - zpt_nominal + zpt_real + cell_offset ~ 0.0 126 # zpt_real (in this case) = 25.0 (actually, it is the value in the vector 'zpt' for this entry 127 # zpt_nominal = 24.58 128 for ix 0 $NCELL_X 129 for iy 0 $NCELL_Y 130 # vstat -q dm$ix\$iy 131 # echo cell_off[$ix][$iy] {$MEDIAN - $ZPT_NOMINAL + $ZPT_REAL + cell_off[$ix][$iy]} $MEDIAN $MEAN $SIGMA 132 133 set dm_adjust = dm$ix\$iy - $ZPT_NOMINAL + $ZPT_REAL + cell_off[$ix][$iy] 134 vstat dm_adjust 127 # uncorrected values behave like this: 128 # mag_DVO = m_inst + zpt_nominal 129 # mag_real = m_inst + zpt_real + cell_offset 130 # dm = mag_DVO - mag_real = zpt_nominal - zpt_real - cell_offset 131 # <dm> - zpt_nominal + zpt_real + cell_offset ~ 0.0 132 # zpt_real (in this case) = 25.0 (actually, it is the value in the vector 'zpt' for this entry 133 # zpt_nominal = 24.58 134 135 # setphot-corrected values behave like this: 136 # mag_DVO = mag_real (because m_inst has cell_offset applied) 137 # dm = mag_DVO - mag_real ~ 0.0 138 139 if ("$3" == "raw") 140 for ix 0 $NCELL_X 141 for iy 0 $NCELL_Y 142 # vstat -q dm$ix\$iy 143 # echo cell_off[$ix][$iy] {$MEDIAN - $ZPT_NOMINAL + $ZPT_REAL + cell_off[$ix][$iy]} $MEDIAN $MEAN $SIGMA 144 145 set dm_adjust = dm$ix\$iy - $ZPT_NOMINAL + $ZPT_REAL + cell_off[$ix][$iy] 146 vstat dm_adjust 147 end 135 148 end 149 else 150 vstat dm 136 151 end 137 152 end … … 145 160 local i 146 161 147 # we have defined a set of images by mjd and zero point148 # for i 0 mjd []162 # we have defined a set of mjd and zero point values for ubercal'ed images 163 # for i 0 mjd_uc[] 149 164 for i 0 1 150 mkexposure $1.$i $RA_CENTER $DEC_CENTER zpt[$i] mjd[$i] g $2 165 mkexposure $1.$i $RA_CENTER $DEC_CENTER zpt_uc[$i] mjd_uc[$i] g $2 166 end 167 168 # we have a second set of mjd and zero point values for non-ubercal'ed images 169 # for i 0 mjd_nc[] 170 for i 0 1 171 mkexposure $1.$i $RA_CENTER $DEC_CENTER zpt_nc[$i] mjd_nc[$i] g $2 151 172 end 152 173 end … … 180 201 $ra = $RAo - $dx / 3600.0 / dcos($DECo) 181 202 $dec = $DECo - $dy / 3600.0 182 echo $ra $dec $dx $dy203 # echo $ra $dec $dx $dy 183 204 mkinput test.in.txt $ra $dec $ZPT 184 205 185 206 # ra,dec is the center of this chip 186 207 exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise -size $CHIP_DX $CHIP_DY -crpix {0.5*$CHIP_DX} {0.5*$CHIP_DY} 187 echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise -size $CHIP_DX $CHIP_DY -crpix {0.5*$CHIP_DX} {0.5*$CHIP_DY}208 # echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise -size $CHIP_DX $CHIP_DY -crpix {0.5*$CHIP_DX} {0.5*$CHIP_DY} 188 209 189 210 # the fake images have inconsistent ra,dec and airmass,sidtime values … … 271 292 keyword phu TS0_0002 -wf 55020.0 272 293 keyword phu TS1_0002 -wf 55030.0 273 274 # create 9 exposures, 3 per season275 create imageID 0 9276 set zpt = 25.0 + imageID*0.0050 - 0.0025277 set mjd = zero(zpt)278 mjd[0] = 55000.01279 mjd[1] = 55000.02280 mjd[2] = 55000.03281 282 mjd[3] = 55015.01283 mjd[4] = 55015.02284 mjd[5] = 55015.03285 286 mjd[6] = 55025.01287 mjd[7] = 55025.02288 mjd[8] = 55025.03289 294 290 295 # create a single flat-field correction map for a single chip … … 319 324 end 320 325 321 set mjd_obs = mjd 322 set zp = zpt 323 set resid = 0.02*rnd(zpt) - 0.01 326 # the output fits table uses the vector names for the field names, 327 # so set them here to the desired names 328 set mjd_obs = mjd_uc 329 set zp = zpt_uc 330 set resid = 0.02*rnd(zpt_uc) - 0.01 324 331 325 332 delete -q flatcorr … … 330 337 # filter 1 331 338 write testzpt.fits -fits ZPTS_1 -f DDE -append mjd_obs zp resid 332 keyword flatcorr FILTER -w sg339 keyword flatcorr FILTER -w g 333 340 keyword flatcorr EXTNAME -w FLATCORR 334 341 wd -extend flatcorr testzpt.fits … … 336 343 # filter 2 (?) 337 344 write testzpt.fits -fits ZPTS_2 -f DDE -append mjd_obs zp resid 338 keyword flatcorr FILTER -w sr345 keyword flatcorr FILTER -w r 339 346 keyword flatcorr EXTNAME -w FLATCORR 340 347 wd -extend flatcorr testzpt.fits … … 342 349 # filter 3 343 350 write testzpt.fits -fits ZPTS_3 -f DDE -append mjd_obs zp resid 344 keyword flatcorr FILTER -w si351 keyword flatcorr FILTER -w i 345 352 keyword flatcorr EXTNAME -w FLATCORR 346 353 wd -extend flatcorr testzpt.fits 347 354 end 355 356 # create a populated catdir with a couple of cmf files 357 macro test.relphot 358 if ($0 != 3) 359 echo "test.relphot (cmftype) (dvotype)" 360 break 361 end 362 363 tapPLAN 4 364 365 exec rm -rf catdir.test 366 367 $RA = 10.0 368 $DEC = 20.0 369 370 for i 0 $offset:n 371 mkinput test.in.txt $offset:$i 372 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 373 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 374 end 375 376 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 377 378 catdir catdir.test 379 skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 380 381 imextract time Mcal 382 383 for i 0 $offset:n 384 tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i" 385 end 386 387 exec rm test.cmf test.in.txt 388 exec rm -r catdir.test 389 390 tapDONE 391 end 392
Note:
See TracChangeset
for help on using the changeset viewer.
