IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42611


Ignore:
Timestamp:
Feb 6, 2024, 10:11:52 AM (2 years ago)
Author:
eugene
Message:

adding more tools for testing xcstack stuff

Location:
branches/eam_branches/ipp-20230313/tools/eam/xcstack.20231124
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/tools/eam/xcstack.20231124/make.xcstack.v1.sh

    r42604 r42611  
    4040EOF
    4141
    42 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam1 < make.xcstack.sql
    43 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam2 < make.xcstack.sql
    44 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_xcam < make.xcstack.sql
     42pxadmin -dbname test_cam1 -create
     43pxadmin -dbname test_cam2 -create
     44pxadmin -dbname test_xcam -create
     45
     46exit 2
     47
     48#$MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam1 < make.xcstack.sql
     49#$MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam2 < make.xcstack.sql
     50#$MYSQL -h $dbserver -u $dbuser -p$dbpass test_xcam < make.xcstack.sql
    4551
    4652echo "******** add skycell info ********"
     
    5258  insert into dbversion (schema_version) values ('0.1');
    5359EOF
     60if ($status) then
     61 echo "ERROR: failed in mysql load for test_xcam"
     62 exit 2
     63 endif
     64 
    5465$MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam1 <<EOF
    5566  insert into skycell (tess_id, skycell_id, radeg, decdeg, width, height) values ('Fake.Tess', 'skycell.2479.024', 200.4, 60.0, 0.433333, 0.438819);
     
    5768  insert into dbversion (schema_version) values ('0.1');
    5869EOF
     70if ($status) then
     71 echo "ERROR: failed in mysql load for test_cam1"
     72 exit 2
     73 endif
     74
    5975$MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam2 <<EOF
    6076  insert into skycell (tess_id, skycell_id, radeg, decdeg, width, height) values ('Fake.Tess', 'skycell.2479.024', 200.4, 60.0, 0.433333, 0.438819);
     
    6278  insert into dbversion (schema_version) values ('0.1');
    6379EOF
     80if ($status) then
     81 echo "ERROR: failed in mysql load for test_cam2"
     82 exit 2
     83 endif
    6484
    6585# insert data into the stack tables
     
    82102
    83103rm -f test_$cam.sql
     104echo "SET FOREIGN_KEY_CHECKS=0;" > test_$cam.sql
    84105
    85106set filters  = (g                r                g                )
     
    96117  # generate warps (two filters, two skycells)
    97118  while ($warp_id <= $warp_id_max)
    98     echo "insert into rawExp      (exp_id, exp_name, camera, filter) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter');" >> test_$cam.sql
     119    echo "insert into rawExp      (exp_id, exp_name, camera, filter, fault) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter', 0);" >> test_$cam.sql
    99120    echo "insert into chipRun     (exp_id, chip_id) values ($warp_id, $warp_id);" >> test_$cam.sql
    100121    echo "insert into camRun      (chip_id, cam_id) values ($warp_id, $warp_id);" >> test_$cam.sql
     
    127148
    128149$MYSQL -h $dbserver -u $dbuser -p$dbpass test_$cam < test_$cam.sql
     150if ($status) then
     151 echo "ERROR: failed in mysql inserts for test_cam1"
     152 exit 2
     153 endif
    129154
    130155echo "******** add cam2 stacks and warps ********"
     
    138163
    139164rm -f test_$cam.sql
     165echo "SET FOREIGN_KEY_CHECKS=0;" > test_$cam.sql
    140166
    141167set filters  = (g                r                g                )
     
    152178  # generate warps (two filters, two skycells)
    153179  while ($warp_id <= $warp_id_max)
    154     echo "insert into rawExp      (exp_id, exp_name, camera, filter) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter');" >> test_$cam.sql
     180    echo "insert into rawExp      (exp_id, exp_name, camera, filter, fault) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter', 0);" >> test_$cam.sql
    155181    echo "insert into chipRun     (exp_id, chip_id) values ($warp_id, $warp_id);" >> test_$cam.sql
    156182    echo "insert into camRun      (chip_id, cam_id) values ($warp_id, $warp_id);" >> test_$cam.sql
     
    222248mkdir -p $workdir
    223249
    224 # pretend to run xcstack
     250# (pretend to) run xcstack
    225251set n = 1
    226252while ($n <= $#stk_ids)
     
    263289  set workdir   = (`grep workdir    xcsky.md | awk '{print $3}'`)
    264290 
    265   ## pretend to run xcsky.pl
     291  ## (pretend to) run xcsky.pl
    266292  set n = 1
    267293  while ($n <= $#sky_ids)
     
    310336  set pathbase  = (`grep path_base  xccal.md | awk '{print $3}'`)
    311337 
    312   ## pretend to run xcsky.pl
     338  ## (pretend to) run xccal.pl
    313339  set n = 1
    314340  while ($n <= $#cal_ids)
    315341    # OUTROOT is defined in xccal.pro based on workdir : "%s/%s/%s/%s.%s.cal.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $SKYCAL_ID  ****** TBD *****
     342    # change 'cal' to 'xccal' here?
    316343    if (0 && ($n == 1)) then
    317344      mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n]
     
    344371xcfftool -dbname test_cam1 -updaterun -xcff_id 1 -set_note myNote
    345372 
    346 foreach label (0 1 2)
    347   set cam = cam1
    348   xcfftool -dbname test_$cam -todo -label Test.xcff.$label > xcff.todo.md
    349   set xcff_ids   = (`grep xcff_id           xcff.todo.md | awk '{print $3}'`)
    350   set warp_ids   = (`grep warp_id           xcff.todo.md | awk '{print $3}'`)
    351   set Tskycells  = (`grep skycell_id        xcff.todo.md | awk '{print $3}'`)
    352   set workdir    = (`grep workdir           xcff.todo.md | awk '{print $3}'`)
    353   set warppaths  = (`grep warp_path_base    xcff.todo.md | awk '{print $3}'`)
    354   set srcpaths   = (`grep sources_path_base xcff.todo.md | awk '{print $3}'`)
    355  
    356   ## pretend to run xcsky.pl
    357   set n = 1
    358   while ($n <= $#xcff_ids)
    359     # OUTROOT is defined in xcff.pro based on workdir : "%s/%s/%s/%s.%s.wrp.%s.xcff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $WARP_ID $FF_ID ***** TBD *****
    360     if (1 && ($cam == "cam1") && ($xcff_ids[$n] == 2)) then
    361       mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n]
    362       echo xcff_warp.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --warp_id $warp_ids[$n] --skycell_id $Tskycells[$n] --warp_path_base $warppaths[$n] --sources_path_base $srcpaths[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].wrp.$warp_ids[$n].xcff.$xcff_ids[$n] --camera GPC1
    363            xcff_warp.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --warp_id $warp_ids[$n] --skycell_id $Tskycells[$n] --warp_path_base $warppaths[$n] --sources_path_base $srcpaths[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].wrp.$warp_ids[$n].xcff.$xcff_ids[$n] --camera GPC1
    364     else
    365       xcfftool -dbname test_$cam -addresult -xcff_id $xcff_ids[$n] -warp_id $warp_ids[$n] -path_base $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].wrp.$warp_ids[$n].xcff.$xcff_ids[$n] -hostname elepaio -quality 0 -fault 0
    366       xcfftool -dbname test_$cam -result    -xcff_id $xcff_ids[$n]
    367     endif
    368     @ n++
    369   end
    370 
    371   # get a list of the unique xcff_ids
    372   set xcff_ids_u   = (`grep xcff_id xcff.todo.md | awk '{print $3}' | sort | uniq`)
    373 
    374   ## pretend to run xcsky.pl
    375   set n = 1
    376   while ($n <= $#xcff_ids_u)
    377     # get the workdir from above which matches this uniq xcff_ids:
    378     set workdir_u = ""
    379     set skycell_u = ""
    380     set t = 1
    381     while ($t <= $#xcff_ids)
    382       if ($xcff_ids[$t] == $xcff_ids_u[$n]) then
    383         set workdir_u = $workdir[$n]
    384         set skycell_u = $Tskycells[$n]
     373foreach cam (cam1 cam2)
     374  foreach label (0 1 2)
     375    xcfftool -dbname test_$cam -todo -label Test.xcff.$label > xcff.todo.md
     376    set xcff_ids   = (`grep xcff_id         xcff.todo.md | awk '{print $3}'`)
     377    set xccal_ids  = (`grep xccal_id        xcff.todo.md | awk '{print $3}'`)
     378    set warp_ids   = (`grep warp_id         xcff.todo.md | awk '{print $3}'`)
     379    set Tskycells  = (`grep skycell_id      xcff.todo.md | awk '{print $3}'`)
     380    set workdir    = (`grep workdir         xcff.todo.md | awk '{print $3}'`)
     381    set warppaths  = (`grep warp_path_base    xcff.todo.md | awk '{print $3}'`)
     382    set srcpaths   = (`grep sources_path_base xcff.todo.md | awk '{print $3}'`)
     383
     384    ## (pretend to) run xcff_warp.pl
     385    set n = 1
     386    while ($n <= $#xcff_ids)
     387      # OUTROOT is defined in xcff.pro based on workdir : "%s/%s/%s/%s.%s.wrp.%s.xcff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $WARP_ID $FF_ID ***** TBD *****
     388      # WORKDIR is needed to prevent collisions between (e.g.,) gpc1 and gpc2 jobs for the same skycell, or else add the camera to the output path
     389      if (0 && ($xccal_ids[$n] == 1)) then
     390        mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n]
     391        echo xcff_warp.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --warp_id $warp_ids[$n] --skycell_id $Tskycells[$n] --warp_path_base $warppaths[$n] --sources_path_base $srcpaths[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].$cam.wrp.$warp_ids[$n].xcff.$xcff_ids[$n] --camera GPC1
     392             xcff_warp.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --warp_id $warp_ids[$n] --skycell_id $Tskycells[$n] --warp_path_base $warppaths[$n] --sources_path_base $srcpaths[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].$cam.wrp.$warp_ids[$n].xcff.$xcff_ids[$n] --camera GPC1
     393      else
     394        xcfftool -dbname test_$cam -addresult -xcff_id $xcff_ids[$n] -warp_id $warp_ids[$n] -path_base $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].$cam.wrp.$warp_ids[$n].xcff.$xcff_ids[$n] -hostname elepaio -quality 0 -fault 0
     395        xcfftool -dbname test_$cam -result    -xcff_id $xcff_ids[$n]
    385396      endif
    386       @ t++
     397      @ n++
    387398    end
    388     if ($workdir_u == "") then
    389       echo "ERROR: failed to find workdir for $xcff_ids_u[$n] from $workdir"
    390       exit 2
    391     endif
    392 
    393     # OUTROOT is defined in xcff.pro based on workdir : "%s/%s/%s/%s.%s.xcff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $XCFF_ID **** TBD ***
    394     xcfftool -dbname test_$cam -toadvance -xcff_id $xcff_ids_u[$n]
    395 
    396     if (1 && ($cam == "cam1") && ($xcff_ids[$n] == 2)) then
    397       mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n]
    398       echo xcff_summary.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].xcff.$xcff_ids[$n] --camera GPC1
    399            xcff_summary.pl --dbname test_$cam --xcff_id $xcff_ids[$n] --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].xcff.$xcff_ids[$n] --camera GPC1
    400     else
    401       xcfftool -dbname test_$cam -addsummary -xcff_id $xcff_ids_u[$n] -path_base $workdir_u/Fake.Tess/$skycell_u/Fake.Tess.$skycell_u.xcff.$xcff_ids_u[$n] -dtime_script 0.0 -quality 0 -fault 0 -hostname elepaio
    402     endif
    403     xcfftool -dbname test_$cam -summary    -xcff_id $xcff_ids_u[$n]
    404     @ n++
    405   end
    406 end
    407 
    408 # test the revert process
    409 if (0) then
    410   xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 6 -fault 1
    411   xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 7 -fault 1
    412   xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 8 -fault 1
    413   xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 6
    414   xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 7
    415   xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 8
    416   xcfftool -dbname test_$cam -updatesummary -xcff_id 1 -fault 1
    417   xcfftool -dbname test_$cam -revertsummary -xccal_id 1
    418 endif
     399
     400    # get a list of the unique xcff_ids
     401    set xcff_ids_u   = (`grep xcff_id xcff.todo.md | awk '{print $3}' | sort | uniq`)
     402   
     403    set n = 1
     404    while ($n <= $#xcff_ids_u)
     405      # get the workdir from above which matches this uniq xcff_ids:
     406      set workdir_u = ""
     407      set skycell_u = ""
     408      set xccal_u = ""
     409      set t = 1
     410      while ($t <= $#xcff_ids)
     411        if ($xcff_ids[$t] == $xcff_ids_u[$n]) then
     412          set workdir_u = $workdir[$t]
     413          set skycell_u = $Tskycells[$t]
     414          set xccal_u = $xccal_ids[$t]
     415          set xcff_u = $xcff_ids_u[$n]
     416        endif
     417        @ t++
     418      end
     419      if ($workdir_u == "") then
     420        echo "ERROR: failed to find workdir for $xcff_ids_u[$n] from $workdir"
     421        exit 2
     422      endif
     423
     424      # OUTROOT is defined in xcff.pro based on workdir : "%s/%s/%s/%s.%s.xcff.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $XCFF_ID **** TBD ***
     425      ## (pretend to) run xcff_summary.pl
     426      xcfftool -dbname test_$cam -toadvance -xcff_id $xcff_u
     427   
     428      if (1 && ($xccal_u == 1)) then
     429        mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n]
     430        echo xcff_summary.pl --dbname test_$cam --xcff_id $xcff_u --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].$cam.xcff.$xcff_u --camera GPC1
     431             xcff_summary.pl --dbname test_$cam --xcff_id $xcff_u --outroot $workdir[$n]/Fake.Tess/$Tskycells[$n]/Fake.Tess.$Tskycells[$n].$cam.xcff.$xcff_u --camera GPC1
     432      else
     433        xcfftool -dbname test_$cam -addsummary -xcff_id $xcff_u -path_base $workdir_u/Fake.Tess/$skycell_u/Fake.Tess.$skycell_u.$cam.xcff.$xcff_u -dtime_script 0.0 -quality 0 -fault 0 -hostname elepaio
     434      endif
     435      xcfftool -dbname test_$cam -summary    -xcff_id $xcff_u
     436      @ n++
     437    end
     438  end
     439
     440  # test the revert process
     441  if (0) then
     442    xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 6 -fault 1
     443    xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 7 -fault 1
     444    xcfftool -dbname test_$cam -updateresult -xcff_id 1 -warp_id 8 -fault 1
     445    xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 6
     446    xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 7
     447    xcfftool -dbname test_$cam -revert -xcff_id 1 -warp_id 8
     448    xcfftool -dbname test_$cam -updatesummary -xcff_id 1 -fault 1
     449    xcfftool -dbname test_$cam -revertsummary -xcff_id 1
     450  endif
     451
     452end
    419453
    420454#  -exportrun      list summary results
    421455#  -importrun      list summary results
    422456
    423 exit 2
     457exit 0
Note: See TracChangeset for help on using the changeset viewer.