IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39035 for trunk


Ignore:
Timestamp:
Nov 3, 2015, 10:40:44 PM (11 years ago)
Author:
eugene
Message:

diff test set now runs to completion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/test/mksasdata.dvo

    r39005 r39035  
    2222list expfiles -glob sasdata.v39/*.smf
    2323list stkfiles -glob sasdata.v39/*skycal*.cmf
    24 list wrpfiles -glob sasdata.v39/*ff*.cmf
     24list wrpfiles -glob sasdata.v39/*.wrp.*ff*.cmf
     25list diffiles -glob sasdata.v39/*.WS.dif.*.cmf
     26
     27# fforce summary files are missing metadata from header.  it is supplied
     28# by the ippTools / ippTasks / ippScripts in processing, so we need to
     29# supply it explicitly here:
     30list galfiles
     31  sasdata.v39/RINGS.V3.skycell.1315.090.ff.40278.cmf  3942577  g.00000
     32  sasdata.v39/RINGS.V3.skycell.1315.090.ff.40279.cmf  3942578  i.00000
     33  sasdata.v39/RINGS.V3.skycell.1315.090.ff.40280.cmf  3942579  r.00000
     34  sasdata.v39/RINGS.V3.skycell.1315.090.ff.40281.cmf  3942580  y.00000
     35  sasdata.v39/RINGS.V3.skycell.1315.090.ff.40282.cmf  3942581  z.00000
     36end
    2537
    2638$catdirbase = catdir.sas
    2739$catdir = $OUTDIR/$catdirbase
    2840
     41$catdirbase_diff = catdir.sas.diff
     42$catdir_diff = $OUTDIR/$catdirbase_diff
     43
    2944macro mkfull
    3045  init.db
     46
     47  exec rm -rf $catdir
    3148  mkcatdir.cam
    3249  mkcatdir.stk
     
    3451  mkcal
    3552
     53  exec rm -rf $catdir_diff
     54  mkcatdir.dif
     55  mkcal.dif
     56
    3657  insert.cam
    3758  insert.wrp
    3859  insert.stk
     60  insert.dif
    3961  insert.minis
    4062end
     
    4567  insert.wrp
    4668  insert.stk
     69  insert.dif
    4770  insert.minis
    4871end
     
    82105    keyword im NAXIS2 Ny
    83106    coords im -p {$Nx/2} {$Ny/2}
    84     dbinsert skycell (radeg, decdeg, skycell_id) values ($RA, $DEC, "$mySkyCell")
     107    dbinsert skycell (radeg, decdeg, tess_id, skycell_id) values ($RA, $DEC, $TESS_ID, "$mySkyCell")
    85108  end
    86109   
     
    130153  for i 0 $wrpfiles:n
    131154    $wrpfile = $wrpfiles:$i
    132     echo addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $wrpfile -update -xrad -accept-astrom -quick-airmass
    133     exec addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $wrpfile -update -xrad -accept-astrom -quick-airmass
    134   end
    135   # exec addstar -D CATDIR $catdir -region {$RA-5.0} {$RA+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -resort
    136 end
    137 
    138 macro mkcal
     155    echo addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $wrpfile -update -xrad -accept-astrom
     156    exec addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $wrpfile -update -xrad -accept-astrom
     157  end
     158
     159  # need to generate a sorted database before running loadgalphot
    139160  echo addstar -D CATDIR $catdir -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -resort
    140161  exec addstar -D CATDIR $catdir -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -resort
    141162
     163  for i 0 $galfiles:n
     164    list word -split $galfiles:$i
     165    $cmffile = $word:0
     166    $stkID = $word:1
     167    $filter = $word:2
     168    echo loadgalphot -D CATDIR $catdir -photcode GPC1.$filter.ForcedWarp -image-id $stkID $cmffile
     169    exec loadgalphot -D CATDIR $catdir -photcode GPC1.$filter.ForcedWarp -image-id $stkID $cmffile
     170  end
     171end
     172
     173macro mkcal
    142174  # run relphot
    143175  # echo relphot -D CATDIR $catdir -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -images g,r,i,z,y -update -boundary-tree tess.3pi.fits
     
    147179  echo relastro -v -D CATDIR $catdir -images -update-chips -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update
    148180  exec relastro -v -D CATDIR $catdir -images -update-chips -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update
     181
     182  echo dvolens -D CATDIR $catdir -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update-objects -update
     183  exec dvolens -D CATDIR $catdir -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update-objects -update
     184end
     185
     186# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     187macro mkcatdir.dif
     188  if ($0 != 1)
     189    echo "mkcatdir.dif"
     190    break
     191  end
     192
     193  for i 0 $diffiles:n
     194    $diffile = $diffiles:$i
     195    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update $diffile -accept-astrom
     196    exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update $diffile -accept-astrom
     197    # echo addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $stkfile -update -quick-airmass -D ZERO_POINT_OPTION CHIP_HEADER
     198  end
     199end
     200
     201macro mkcal.dif
     202  echo addstar -D CATDIR $catdir_diff -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -resort
     203  exec addstar -D CATDIR $catdir_diff -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -resort
     204
     205  # run relphot
     206  echo relphot -D CATDIR $catdir_diff -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -averages -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
     207  exec relphot -D CATDIR $catdir_diff -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -averages -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN
     208
     209  echo relastro -v -D CATDIR $catdir_diff -update-objects -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update -D RELASTRO_SRC_MEAS_TOOFEW 0 -D RELASTRO_SIGMA_LIM 0.05 -statmode WTMEAN
     210  exec relastro -v -D CATDIR $catdir_diff -update-objects -region {$RA_FIELD-5.0} {$RA_FIELD+5.0} {$DEC_FIELD-5.0} {$DEC_FIELD+5.0} -update -D RELASTRO_SRC_MEAS_TOOFEW 0 -D RELASTRO_SIGMA_LIM 0.05 -statmode WTMEAN
    149211end
    150212
     
    207269
    208270    # a single exposure
    209     $wrpID = $i + 1
     271    $wrpID = $i + 100
    210272
    211273    # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids
     
    213275    dbinsert fullForceResult (ff_id, warp_id, software_ver, path_base) values ($stkID, $wrpID, "38000M", "$path_base")
    214276
    215     dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($wrpID, "fullforce", "full", $stkID, $wrpID, "catdirbase")
     277    dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($wrpID, "fullforce", "full", $wrpID, $wrpID, "$catdirbase")
    216278
    217279    if ($i > 10) last
     
    256318end
    257319
     320macro insert.dif
     321  if ($0 != 1)
     322      echo "USAGE: insert.dif"
     323      break
     324  end
     325
     326  local difID skycell filter filename path_base
     327
     328  for i 0 $diffiles:n
     329    $filename = $diffiles:$i
     330    strlen $filename Nchar
     331    substr $filename 0 {$Nchar - 4} path_base; # the database needs the path without the extension (.smf/.cmf)
     332
     333    $diffSkyfileID = `echo $filename | fields IMAGEID | prcol 2`
     334    $skycell = "skycell.1315.090"
     335    $filter  = `echo $filename | fields FPA.FILTERID | prcol 2`
     336    $mjd     = `echo $filename | fields MJD-OBS | prcol 2`
     337   
     338    $wrpID = $i
     339    $stkID = $i + 10
     340
     341    $difID = $diffSkyfileID + 25
     342    $addID = $difID + 100
     343
     344    dbinsert addRun (add_id, stage, state, stage_id, stage_extra1, minidvodb_name) values ($addID, "diff", "full", $difID, $diffSkyfileID, "$catdirbase_diff")
     345    dbinsert addProcessedExp (add_id, fault) values ($addID, 0)
     346
     347    dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, $TESS_ID, "full", 2, "38000M")
     348    dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, $TESS_ID, $skycell )
     349    dbinsert diffSkyfile (diff_id, diff_skyfile_id, tess_id, skycell_id, path_base) values ($difID, $diffSkyfileID, $TESS_ID, $skycell, "$path_base")
     350  end
     351end
     352
    258353macro insert.minis
    259354  # catdirs for the exposures
     
    263358  dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (1, 1, "full", "$catdirbase")
    264359  dbinsert mergedvodbProcessed (merge_id, fault) values (1, 0)
     360
     361  # catdirs for the diffs
     362  dbinsert minidvodbRun (minidvodb_name, minidvodb_id, state) values ("$catdirbase_diff", 2, "merged")
     363  dbinsert minidvodbProcessed (minidvodb_id, fault) values (2, 0)
     364
     365  dbinsert mergedvodbRun (minidvodb_id, merge_id, state, mergedvodb) values (2, 2, "full", "$catdirbase_diff")
     366  dbinsert mergedvodbProcessed (merge_id, fault) values (2, 0)
    265367end
    266368
Note: See TracChangeset for help on using the changeset viewer.