Changeset 42611
- Timestamp:
- Feb 6, 2024, 10:11:52 AM (2 years ago)
- Location:
- branches/eam_branches/ipp-20230313/tools/eam/xcstack.20231124
- Files:
-
- 2 added
- 1 edited
-
get.schema.sh (added)
-
make.xcstack.v1.sh (modified) (13 diffs)
-
run.addstar.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/tools/eam/xcstack.20231124/make.xcstack.v1.sh
r42604 r42611 40 40 EOF 41 41 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 42 pxadmin -dbname test_cam1 -create 43 pxadmin -dbname test_cam2 -create 44 pxadmin -dbname test_xcam -create 45 46 exit 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 45 51 46 52 echo "******** add skycell info ********" … … 52 58 insert into dbversion (schema_version) values ('0.1'); 53 59 EOF 60 if ($status) then 61 echo "ERROR: failed in mysql load for test_xcam" 62 exit 2 63 endif 64 54 65 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam1 <<EOF 55 66 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); … … 57 68 insert into dbversion (schema_version) values ('0.1'); 58 69 EOF 70 if ($status) then 71 echo "ERROR: failed in mysql load for test_cam1" 72 exit 2 73 endif 74 59 75 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_cam2 <<EOF 60 76 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); … … 62 78 insert into dbversion (schema_version) values ('0.1'); 63 79 EOF 80 if ($status) then 81 echo "ERROR: failed in mysql load for test_cam2" 82 exit 2 83 endif 64 84 65 85 # insert data into the stack tables … … 82 102 83 103 rm -f test_$cam.sql 104 echo "SET FOREIGN_KEY_CHECKS=0;" > test_$cam.sql 84 105 85 106 set filters = (g r g ) … … 96 117 # generate warps (two filters, two skycells) 97 118 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.sql119 echo "insert into rawExp (exp_id, exp_name, camera, filter, fault) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter', 0);" >> test_$cam.sql 99 120 echo "insert into chipRun (exp_id, chip_id) values ($warp_id, $warp_id);" >> test_$cam.sql 100 121 echo "insert into camRun (chip_id, cam_id) values ($warp_id, $warp_id);" >> test_$cam.sql … … 127 148 128 149 $MYSQL -h $dbserver -u $dbuser -p$dbpass test_$cam < test_$cam.sql 150 if ($status) then 151 echo "ERROR: failed in mysql inserts for test_cam1" 152 exit 2 153 endif 129 154 130 155 echo "******** add cam2 stacks and warps ********" … … 138 163 139 164 rm -f test_$cam.sql 165 echo "SET FOREIGN_KEY_CHECKS=0;" > test_$cam.sql 140 166 141 167 set filters = (g r g ) … … 152 178 # generate warps (two filters, two skycells) 153 179 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.sql180 echo "insert into rawExp (exp_id, exp_name, camera, filter, fault) values ($warp_id, 'name.$warp_id', 'test_$cam', '$filter', 0);" >> test_$cam.sql 155 181 echo "insert into chipRun (exp_id, chip_id) values ($warp_id, $warp_id);" >> test_$cam.sql 156 182 echo "insert into camRun (chip_id, cam_id) values ($warp_id, $warp_id);" >> test_$cam.sql … … 222 248 mkdir -p $workdir 223 249 224 # pretend torun xcstack250 # (pretend to) run xcstack 225 251 set n = 1 226 252 while ($n <= $#stk_ids) … … 263 289 set workdir = (`grep workdir xcsky.md | awk '{print $3}'`) 264 290 265 ## pretend torun xcsky.pl291 ## (pretend to) run xcsky.pl 266 292 set n = 1 267 293 while ($n <= $#sky_ids) … … 310 336 set pathbase = (`grep path_base xccal.md | awk '{print $3}'`) 311 337 312 ## pretend to run xcsky.pl338 ## (pretend to) run xccal.pl 313 339 set n = 1 314 340 while ($n <= $#cal_ids) 315 341 # 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? 316 343 if (0 && ($n == 1)) then 317 344 mkdir -p $workdir[$n]/Fake.Tess/$Tskycells[$n] … … 344 371 xcfftool -dbname test_cam1 -updaterun -xcff_id 1 -set_note myNote 345 372 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] 373 foreach 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] 385 396 endif 386 @ t++397 @ n++ 387 398 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 452 end 419 453 420 454 # -exportrun list summary results 421 455 # -importrun list summary results 422 456 423 exit 2457 exit 0
Note:
See TracChangeset
for help on using the changeset viewer.
