IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2015, 12:43:23 PM (11 years ago)
Author:
eugene
Message:

add mode option to dvo_secfilt_init (so chip, warp, stack can be reset independently); add HAS_TYCHO, FIX_SYNTH to secfilt flags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/relphot.flatcorr.dvo

    r38315 r38318  
    2121if (not($?PLOT)) set PLOT = 0
    2222
    23 $USE_CELL_OFFSETS = 0; # turn on non-zero cell offsets
     23$USE_CELL_OFFSETS = 1; # turn on non-zero cell offsets
    2424$SET_UC_RESID = 1; # write a non-zero resid value to the ubercal table (should not have an impact)
    25 $DO_2MASS = 0
    26 $DO_SYNTH = 0
    27 $DO_TYCHO = 0
     25$DO_2MASS = 1
     26$DO_SYNTH = 1
     27$DO_TYCHO = 1
    2828$NC_CLOUDS = 0.08
    2929$UC_CLOUDS = 0.02
     
    196196  tapEXEC relphot -images g,r -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 -D IMAGE_OFFSET 0.5 -update -synthphot_zpts $fileroot.synthzpts.fits
    197197  for i 0 mjd_uc[]
    198     ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot
     198    ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc
    199199  end
    200200  for i 0 mjd_nc[]
    201     ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot
     201    ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
    202202  end
    203203  ck2mass relphot
     204  cksynth relphot
     205  cktycho relphot
    204206
    205207  tapDONE
     
    207209
    208210macro try.relphot
     211  if ($0 != 3)
     212    echo "go (fileroot) (catdir)"
     213    break
     214  end
     215
     216  local i fileroot rootdir catdir
     217
     218  $fileroot = $1
     219  $catdir = $2
     220
    209221  # run relphot on the db and check that the images now match the expected values
    210   # tapEXEC relphot -images g,r -v -region 9.5 10.5 19.5 20.5 -D CATDIR $1 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -D IMAGE_OFFSET 0.5 -update -synthphot_zpts $fileroot.synthzpts.fits
    211   tapEXEC relphot -images g,r -v -region 9.5 10.5 19.5 20.5 -D CATDIR $1 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -D IMAGE_OFFSET 0.5 -update
     222  tapEXEC relphot -images g,r -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 -D IMAGE_OFFSET 0.5 -update -synthphot_zpts $fileroot.synthzpts.fits -nloop 24
     223
    212224  for i 0 mjd_uc[]
    213     ckexposure $1 mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot
     225    # ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc
     226      ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc
    214227  end
    215228  for i 0 mjd_nc[]
    216     ckexposure $1 mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot
     229    # ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
     230      ckexposure $catdir mjd_nc[$i] zpt_nc[$i] exptime_nc[$i] airmass_nc[$i] $filt_nc:$i relphot_nc
    217231  end
    218232end
     
    256270  $AIRMASS     = $5
    257271  $FILTER      = $6
    258   $MODE        = $7
     272  $FUNC_MODE   = $7
    259273
    260274  # XXX need a function to extract the nominal zpt for a given filter / photcode from the db
     
    325339  $ZPT_REAL_NORM = $ZPT_REAL - 2.5*log($EXPTIME) - $KLAM_NOMINAL*($AIRMASS - 1.0)
    326340
    327   if ("$MODE" == "raw")
     341  if ("$FUNC_MODE" == "raw")
    328342    for ix 0 $NCELL_X
    329343      for iy 0 $NCELL_Y
     
    342356  end
    343357
    344   if ("$MODE" == "setphot_uc")
     358  if ("$FUNC_MODE" == "setphot_uc")
    345359    vstat -q dm_good
    346360    sprintf line "setphot_uc  ZP %8.2f $FILTER %6.3f %6.3f %6.3f: %7.4f %7.4f : %3d" $MJD_IMAGE $ZPT_REAL $ZPT_REAL_NORM $ZPT_NOMINAL $MEAN $SIGMA dm_good[]
     
    357371  end
    358372
    359   if ("$MODE" == "setphot_nc")
     373  if ("$FUNC_MODE" == "setphot_nc")
    360374    vstat -q dm_good
    361375    sprintf line "setphot_nc  ZP %8.2f $FILTER %6.3f %6.3f %6.3f: %7.4f %7.4f : %3d" $MJD_IMAGE $ZPT_REAL $ZPT_REAL_NORM $ZPT_NOMINAL $MEAN $SIGMA dm_good[]
     
    372386  end
    373387
    374   if ("$MODE" == "relphot")
     388  if (("$FUNC_MODE" == "relphot_uc") || ("$FUNC_MODE" == "relphot_nc"))
    375389    vstat -q dm_good
    376390    sprintf line "relphot     ZP %8.2f $FILTER %6.3f %6.3f %6.3f: %7.4f %7.4f : %3d" $MJD_IMAGE $ZPT_REAL $ZPT_REAL_NORM $ZPT_NOMINAL $MEAN $SIGMA dm_good[]
    377     tapOK {abs($MEAN) < 0.001} "$line"
    378     tapOK {abs($SIGMA) < 0.001} "$line"
     391
     392    if ("$FUNC_MODE" == "relphot_uc")
     393      tapOK {abs($MEAN) < 0.001} "$line"
     394      tapOK {abs($SIGMA) < 0.001} "$line"
     395    end
     396    if ("$FUNC_MODE" == "relphot_nc")
     397      # XXX NOTE relaxed condition : bad photometry points are partly clipped but still cause a bias
     398      tapOK {abs($MEAN) < 0.020} "$line"
     399      tapOK {abs($SIGMA) < 0.020} "$line"
     400    end
    379401
    380402    mextract ra dec dbflags
     
    390412    return
    391413  end
     414
     415  echo "ERROR: unknown mode for ckexposure : $FUNC_MODE"
    392416
    393417end
     
    704728  tapEXEC addstar -ref $ROOT.tycho.dat -D CATDIR $CATDIR -D CAMERA gpc1 -quick-airmass -photcode TYCHO_B
    705729
    706   # $KAPA = kapa -noX
     730  $KAPA = kapa -noX
    707731  dev -n tmpdev
    708732  # resize 100 100
     
    714738  cdensify tmpmap tmp tmp
    715739  set map = zero(tmpmap) + 0.2
    716   # close
     740  close
    717741  $KAPA = kapa
    718742
     
    746770
    747771  if ("$1" == "relphot")
    748     subset rs = r_tycho if (m_tycho < 12)
    749     subset ds = d_tycho if (m_tycho < 12)
    750     avmatch rs ds 0.1 g:flags
    751     subset tmp = rs if (g:flags & 0x04); # tycho used for photometry
    752     tapOK {tmp[] == rs[]} "tycho objects used for photometry properly marked"
     772    subset rst = r_tycho if (m_tycho < 12)
     773    subset dst = d_tycho if (m_tycho < 12)
     774    # XXX : should not restrict to 'g'
     775    avmatch rst dst 0.1 g:flags
     776    subset tmp = rst if (g:flags & 0x40); # tycho used for photometry
     777    tapOK {tmp[] == rst[]} "tycho objects used for photometry properly marked"
     778
     779    # non-tycho stars with synth phot should be repaired
     780    subset rsn = r_synth if (m_synth > 12) && (m_synth < 13.5)
     781    subset dsn = d_synth if (m_synth > 12) && (m_synth < 13.5)
     782    # XXX : should not restrict to 'g'
     783    avmatch rsn dsn 0.1 g:flags
     784    subset tmp = rsn if (g:flags & 0x80); # synth photometry repaired
     785    tapOK {tmp[] == rsn[]} "tycho objects used for photometry properly marked"
    753786  end
    754787end
Note: See TracChangeset for help on using the changeset viewer.