Changeset 41386
- Timestamp:
- Jul 3, 2020, 2:11:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20200519/test/relphot.tgroups.dvo
r41370 r41386 47 47 tapPLAN {((mjd_uc[]*4 + mjd_nc[]*4) + (mjd_uc[] + mjd_nc[]) + (mjd_uc[] + mjd_nc[])) / 3} 48 48 49 # XXX first, run the analysis with only ubercal data (photometric data) 50 # we should be able to recover the nightly zero points fitting only tgroups 51 49 52 # generate the basic images and check they were correctly ingested by dvo 50 53 for i 0 mjd_uc[] 51 mkexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i $fileroot $RA_CENTER $DEC_CENTER 52 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i raw 54 sprintf filerootout "%s.%02d" $fileroot $i 55 mkexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] secz_uc[$i] $FILTER $filerootout $RA_CENTER $DEC_CENTER 56 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] secz_uc[$i] $FILTER raw 57 end 58 59 break 60 61 # run relphot on the db and check that the images now match the expected values 62 tapEXEC relphot -tgroup-fit-airmass -tgroups tgroups.dat -images g -v -region $RA_MIN $RA_MAX $DEC_MIN $DEC_MAX -D CATDIR $catdir -D STAR_TOOFEW 1 -statmode WT_MEAN -cloud-limit 0.5 -update -nloop 12 63 64 break 65 66 # reset the per-filter ZPT_OFF:$filter values 67 $ZPT_OFF:$FILTER = NAN 68 69 for i 0 mjd_uc[] 70 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $FILTER relphot_uc 53 71 end 54 72 for i 0 mjd_nc[] 55 mkexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i $fileroot $RA_CENTER $DEC_CENTER 56 ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i raw 57 end 58 59 # run relphot on the db and check that the images now match the expected values 60 tapEXEC relphot -images g,r -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -statmode WT_MEAN -cloud-limit 0.5 -update -nloop 12 61 62 # reset the per-filter ZPT_OFF:$filter values 63 for i 0 $filt_uc:n 64 $filter = $filt_uc:$i 65 $ZPT_OFF:$filter = NAN 66 end 67 for i 0 $filt_nc:n 68 $filter = $filt_nc:$i 69 $ZPT_OFF:$filter = NAN 70 end 71 72 for i 0 mjd_uc[] 73 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc 74 end 75 for i 0 mjd_nc[] 76 ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 73 ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $FILTER relphot_nc 77 74 end 78 75 tapDONE … … 88 85 $DEC_CENTER = 20.0 89 86 $PLATE_SCALE = 0.25 90 $NSEASON = 3 91 $NFILTER = 3 92 $NCHIP_X = 2 93 $NCHIP_Y = 2 94 $NCELL_X = 2 95 $NCELL_Y = 2 87 $NCHIP_X = 1 88 $NCHIP_Y = 1 96 89 $CHIP_DX = 1000 97 90 $CHIP_DY = 1000 98 $DEFECT_FRAC = 0.05 99 $OFFSET_FRAC_UC = 0.0 100 $OFFSET_FRAC_NC = 0.5 91 $DEFECT_FRAC = 0.00 101 92 102 93 # we have two sets of images: ubercal (photometric) and not-ubercaled … … 104 95 # ********* UBERCAL IMAGES *********** 105 96 106 # the number of exposures is defined by filt_uc:n 107 list filt_uc -split g g g g r r r r 108 109 # tmpseq is used to generate vectors in this function 110 create tmpseq 0 $filt_uc:n 111 112 # exptime and airmasses for uc images 113 set exptime_uc = 10.0 + zero(tmpseq) 114 115 # XXX range of airmass 116 set airmass_uc = 1.3 + zero(tmpseq) 117 set klam_uc = zero(tmpseq) 118 set zpt_uc = zero(tmpseq) 119 120 # ubercal zero points are defined as ZP_nominal + 2.5log(exptime) + K*(airmass - 1.0) 121 # note that K is defined as a negative value (is this sensible?) 122 123 # zero points and airmass slopes for these sequences 124 for i 0 $filt_uc:n 125 klam_uc[$i] = $klam_nominal:$filt_uc:$i 126 zpt_uc[$i] = $zpt_nominal:$filt_uc:$i + 2.5*log(exptime_uc[$i]) + klam_uc[$i]*(airmass_uc[$i] - 1.0) + $UC_CLOUDS*(rnd(klam_uc[$i]) - 0.5) 127 $ZPT_OFF:$filt_uc:$i = NAN 97 # ubercal nights each have a distinct zero point and slope: 98 vlist night_uc 55000.0 55010.0 55030.0 55060.0 99 vlist dz_nt_uc +0.0000 +0.0300 -0.0200 -0.0400 100 # vlist dk_nt_uc +0.0000 +0.0005 -0.0005 -0.0002 101 vlist dk_nt_uc +0.0000 +0.0200 -0.0200 +0.0300 102 103 write tgroups.dat night_uc 104 105 $EXPTIME = 10.0 106 $FILTER = g 107 $ZPT_OFF:$FILTER = NAN 108 109 delete -q mjd_uc seq_uc zpt_uc klam_uc secz_uc exptime_uc 110 111 # generate 5 exposures for each night 112 for i 0 5 113 set secz_tmp = rnd(night_uc) + 1.0; # airmass in range 1.0 - 2.0 114 set klam_tmp = $klam_nominal:$FILTER + dk_nt_uc 115 set exp_tmp = zero(night_uc) + $EXPTIME 116 set zpt_tmp = $zpt_nominal:$FILTER + dz_nt_uc + 2.5*log(exp_tmp) + klam_tmp*(secz_tmp - 1.0) 117 118 set seq_tmp = ramp(night_uc) 119 set mjd_tmp = night_uc + 0.33 + 0.01*$i; # exposures are 14 minutes apart starting at 10pm HST 120 121 concat klam_tmp klam_uc 122 concat secz_tmp secz_uc 123 concat zpt_tmp zpt_uc 124 concat seq_tmp seq_uc 125 concat mjd_tmp mjd_uc 126 127 concat exp_tmp exptime_uc 128 128 end 129 set mjd_uc = 55000.00 + 0.01*(tmpseq % 3) + 10.0*int(tmpseq / 3)130 129 131 130 # ********* NON-UBERCAL IMAGES *********** 132 131 133 # mjd and zpt values for not-ubercal'ed images 134 list filt_nc -split g g g g r r r r 135 136 # tmpseq is used to generate vectors in this function 137 create tmpseq 0 $filt_nc:n 138 139 # place this within a valid season (55000.0 - 55010.0 - 55020.0 - 55030.0) 140 set exptime_nc = 10.0 + zero(tmpseq) 141 set airmass_nc = 1.6 + zero(tmpseq) 142 set klam_nc = zero(tmpseq) 143 set zpt_nc = zero(tmpseq) 144 145 # airmass slopes for these sequnece 146 for i 0 $filt_nc:n 147 klam_nc[$i] = $klam_nominal:$filt_nc:$i 148 zpt_nc[$i] = $zpt_nominal:$filt_nc:$i + 2.5*log(exptime_nc[$i]) + klam_nc[$i]*(airmass_nc[$i] - 1.0) + $NC_CLOUDS*(rnd(klam_nc[$i]) - 0.5) 149 $ZPT_OFF:$filt_uc:$i = NAN 132 # non-ubercal nights each have a random zero points and fixed slope (klam_nominal) 133 # non-ubercal nights must not be the same set as the ubercal nights above 134 vlist night_nc 55005.0 55015.0 55035.0 55065.0 135 136 delete -q mjd_nc seq_nc zpt_nc klam_nc secz_nc 137 138 # generate 5 exposures for each night 139 for i 0 5 140 set secz_tmp = rnd(night_nc) + 1.0; # airmass in range 1.0 - 2.0 141 set klam_tmp = zero(night_nc) + $klam_nominal:$FILTER 142 set exp_tmp = zero(night_nc) + $EXPTIME 143 set zpt_tmp = $zpt_nominal:$FILTER + 2.5*log(exp_tmp) + klam_tmp*(secz_tmp - 1.0) - $NC_CLOUDS*(0.1 + rnd(secz_tmp)) 144 # observed zero points for nc nights are 0.1 - 1.1 lower than the ubercal nights 145 146 set seq_tmp = ramp(night_nc) 147 set mjd_tmp = night_nc + 0.33 + 0.01*$i; # exposures are 14 minutes apart starting at 10pm HST 148 149 concat klam_tmp klam_nc 150 concat secz_tmp secz_nc 151 concat zpt_tmp zpt_nc 152 concat seq_tmp seq_nc 153 concat mjd_tmp mjd_nc 154 155 concat exp_tmp exptime_nc 150 156 end 151 set mjd_nc = 55000.10 + 0.01*(tmpseq % 3) + 10.0*int(tmpseq / 3)152 153 delete tmpseq154 157 end 155 158 … … 169 172 170 173 # reset the per-filter ZPT_OFF:$filter values 171 for i 0 $filt_uc:n 172 $filter = $filt_uc:$i 173 $ZPT_OFF:$filter = NAN 174 end 175 for i 0 $filt_nc:n 176 $filter = $filt_nc:$i 177 $ZPT_OFF:$filter = NAN 178 end 174 $ZPT_OFF:$FILTER = NAN 179 175 180 176 for i 0 mjd_uc[] 181 # ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc 182 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc 183 end 184 for i 0 mjd_nc[] 185 # ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 186 ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc 177 # ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $FILTER relphot_uc 178 ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $FILTER relphot_uc 187 179 end 188 180 end … … 222 214 end 223 215 224 skyregion {$RA_CENTER - 0.2/dcos($DEC_CENTER)} {$RA_CENTER + 0.2/dcos($DEC_CENTER)} {$DEC_CENTER - 0.2} {$DEC_CENTER + 0.2} 216 # RA_MIN, etc are defined by mkstars 217 skyregion $RA_MIN $RA_MAX $DEC_MIN $DEC_MAX 225 218 226 219 ## calculate the average zero point offset … … 331 324 $dec = $DECo - $dy / 3600.0 332 325 # echo $ra $dec $dx $dy 333 mkinput test.in.txt $ra $dec $ZPT326 mkinput $ROOT.$ix.$iy.in.txt $ra $dec $ZPT 334 327 335 328 # ra,dec is the center of this chip … … 353 346 $options = $options -exptime $EXPTIME 354 347 355 tapEXEC mkcmf test.in.txt $ROOT.$ix.$iy.cmf $options348 tapEXEC mkcmf $ROOT.$ix.$iy.in.txt $ROOT.$ix.$iy.cmf $options 356 349 357 350 # the fake images have inconsistent ra,dec and airmass,sidtime values … … 437 430 # the images are oriented along N-S, E-W lines 438 431 439 # size of region of interest in linear arcseconds 440 $RA_RANGE = 1.25 * $CHIP_DX * $NCHIP_X * $PLATE_SCALE 441 $DEC_RANGE = 1.25 * $CHIP_DY * $NCHIP_Y * $PLATE_SCALE 432 # size of region of interest in linear degrees 433 $RA_RANGE = 1.25 * $CHIP_DX * $NCHIP_X * $PLATE_SCALE / 3600 434 $DEC_RANGE = 1.25 * $CHIP_DY * $NCHIP_Y * $PLATE_SCALE / 3600 435 436 $RA_MIN = $RA_CENTER - 0.5*$RA_RANGE/dcos($DEC_CENTER) 437 $RA_MAX = $RA_CENTER + 0.5*$RA_RANGE/dcos($DEC_CENTER) 438 $DEC_MIN = $DEC_CENTER - 0.5*$DEC_RANGE 439 $DEC_MAX = $DEC_CENTER + 0.5*$DEC_RANGE 442 440 443 441 create tmp 0 $1 444 set stars_ra = $RA_CENTER + $RA_RANGE * (rnd(tmp) - 0.5) / 3600 /dcos ($DEC_CENTER)445 set stars_dec = $DEC_CENTER + $DEC_RANGE * (rnd(tmp) - 0.5) / 3600442 set stars_ra = $RA_CENTER + $RA_RANGE * (rnd(tmp) - 0.5) / dcos ($DEC_CENTER) 443 set stars_dec = $DEC_CENTER + $DEC_RANGE * (rnd(tmp) - 0.5) 446 444 set stars_mag = 10.0 + 10.0 * rnd(tmp) 447 445 set stars_dmag = 0.02 + 0.1 * rnd(tmp)
Note:
See TracChangeset
for help on using the changeset viewer.
