Skip to content
Snippets Groups Projects
Commit ff7a0202 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Add optional event views

parent 63168a37
Branches
Tags
1 merge request!70Add optional event views
Pipeline #9140 failed
...@@ -84,7 +84,11 @@ include: ...@@ -84,7 +84,11 @@ include:
- local: 'views/view3.yml' - local: 'views/view3.yml'
- local: 'views/view6.yml' - local: 'views/view6.yml'
- local: 'views/view7.yml' - local: 'views/view7.yml'
- local: 'views/config.yml' - local: 'views/view11.yml'
- local: 'views/view12.yml'
- local: 'views/view13.yml'
- local: 'views/view14.yml'
- local: 'views/view15.yml'
report: report:
stage: finalize stage: finalize
......
#!/bin/bash #!/bin/bash
#trignometry #trignometry
sin () #sin ()
{ #{
echo "scale=5;s($1)" | bc -l # echo "scale=5;s($1)" | bc -l
} #}
#
add () #add ()
{ #{
echo "scale=5;$1 + $2" | bc -l # echo "scale=5;$1 + $2" | bc -l
} #}
#
cos () #cos ()
{ #{
echo "scale=5;c($1)" | bc -l # echo "scale=5;c($1)" | bc -l
} #}
#
tan () #tan ()
{ #{
echo "scale=5;s($1)/c($1)" | bc -l # echo "scale=5;s($1)/c($1)" | bc -l
} #}
function print_the_help { function print_the_help {
......
#!/bin/bash
#trignometry
#sin ()
#{
# echo "scale=5;s($1)" | bc -l
#}
#
#add ()
#{
# echo "scale=5;$1 + $2" | bc -l
#}
#
#cos ()
#{
# echo "scale=5;c($1)" | bc -l
#}
#
#tan ()
#{
# echo "scale=5;s($1)/c($1)" | bc -l
#}
function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> "
echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)"
exit
}
FILE_TAG="view15"
INPUT_FILE="../../g4_0000.prim"
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-t|--tag)
FILE_TAG="$2"
shift # past argument
shift # past value
;;
-i|--input)
INPUT_FILE="$2"
shift # past argument
shift # past value
;;
*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1"
print_the_help
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# units are mm
echo "view15 produces a series of slightly rotated XY slices a different z locations. Along beamline"
# slice at z = 2m
# note the offset has to change with sign of the direction to cut in the opposite direction.
#dawncut 0 0 1 10005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
#dawncut 0 0 -1 -1000 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
#dawn ${FILE_TAG}b.prim
#ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
#gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
# -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
# -f ${FILE_TAG}b_full.pdf
#pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
echo "done ..."
original_file_tag="${FILE_TAG}"
make_slice(){
local zpos="$1"
local tagnum=$(printf "%04d" ${zpos})
local FILE_TAG="${original_file_tag}a${tagnum}"
local z1=$(add ${zpos} 100)
local z2=$(add ${zpos} -100)
#dawncut 0 0 1 ${z1}1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
#dawncut 0 0 -1 -${z2}0 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
../../bin/dawn_tweak -z ${zpos}0 --draw 5
#cp ${INPUT_FILE} ${FILE_TAG}.prim
dawncut -1 0 0 0 ${INPUT_FILE} ${FILE_TAG}.prim
dawn -d ${FILE_TAG}.prim
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}_full.pdf
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox
rm "${FILE_TAG}_temp0.prim"
rm "${FILE_TAG}.prim"
}
for zzz in $(seq 150 50 2000) ;
do
make_slice ${zzz}
done
wait
#dawncut 0 1 0 10 ${INPUT_FILE} ${FILE_TAG}c_temp0.prim
#dawncut 0 -1 0 0 ${FILE_TAG}c_temp0.prim ${FILE_TAG}c.prim
#dawn -d ${FILE_TAG}c.prim
#ps2pdf ${FILE_TAG}c.eps ${FILE_TAG}c_full.pdf
#gs -o ${FILE_TAG}c.pdf -sDEVICE=pdfwrite \
# -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
# -f ${FILE_TAG}c_full.pdf
#pdftoppm ${FILE_TAG}c.pdf ${FILE_TAG}c -png -singlefile -cropbox
#
## slice at z = -1m
#dawncut 0 0 1 -1000 ${INPUT_FILE} ${FILE_TAG}d_temp0.prim
#dawncut 0 0 -1 1001 ${FILE_TAG}d_temp0.prim ${FILE_TAG}d.prim
#dawn -d ${FILE_TAG}d.prim
#ps2pdf ${FILE_TAG}d.eps ${FILE_TAG}d_full.pdf
#gs -o ${FILE_TAG}d.pdf -sDEVICE=pdfwrite \
# -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
# -f ${FILE_TAG}d_full.pdf
#pdftoppm ${FILE_TAG}d.pdf ${FILE_TAG}d -png -singlefile -cropbox
#
## slice at z = -2m
#dawncut 0 0 1 -2000 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim
#dawncut 0 0 -1 2001 ${FILE_TAG}e_temp0.prim ${FILE_TAG}e.prim
#dawn -d ${FILE_TAG}e.prim
#ps2pdf ${FILE_TAG}e.eps ${FILE_TAG}e_full.pdf
#gs -o ${FILE_TAG}e.pdf -sDEVICE=pdfwrite \
# -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
# -f ${FILE_TAG}e_full.pdf
#pdftoppm ${FILE_TAG}e.pdf ${FILE_TAG}e -png -singlefile -cropbox
#https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html
# % dawncut a b c d input-file [output-file]
#
# input-file : Source DAWN-format file describing a 3D scene.
#
# output-file: Output DAWN-format file describing a plane-clipped
# 3D scene. The default output stream is stdout.
#
# a, b, c, d : Parameters a, b, c, and d are double values to
# define a clipping plane described with the following
# equation:
#
# ax + by + cz + d = 0.
#
# Vector (a,b,c) defines the normal vector of
# the clipping plane.
# 3D scene data in the half space at the front side
# of the clipping plane are clipped out and erased.
# The normal vector (a,b,c) needs not be a unit vector.
# If it is a unit vector, parameter "d" gives distance
# between the clipping plane and origin (0,0,0).
dawn_view_11:detector: #dawn_view_13:detector:
extends: .views # extends: .views
script: # script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -D # - ./bin/make_dawn_views -t view13 -d scripts/view13 -D
dawn_view_11:ev000: #dawn_view_14:detector:
extends: .views # extends: .views
script: # script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 # - ./bin/make_dawn_views -t view14 -d scripts/view14 -D
dawn_view_11:ev001:
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 1
dawn_view_11:ev002:
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 2
dawn_view_11:ev003:
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 3
dawn_view_11:ev004:
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 4
dawn_view_12:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view12 -d scripts/view12 -D
dawn_view_13:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view13 -d scripts/view13 -D
dawn_view_14:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view14 -d scripts/view14 -D
...@@ -4,17 +4,28 @@ dawn_view_01:detector: ...@@ -4,17 +4,28 @@ dawn_view_01:detector:
- ./bin/make_dawn_views -t view01 -d scripts/view1 -D - ./bin/make_dawn_views -t view01 -d scripts/view1 -D
dawn_view_01:ev001: dawn_view_01:ev001:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 1 - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 1
dawn_view_01:ev002: dawn_view_01:ev002:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 2 - ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 2
view_01: view_01:
stage: test stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: needs:
- ["dawn_view_01:detector", "dawn_view_01:ev001","dawn_view_01:ev002"] - job: dawn_view_01:detector
optional: false
- job: dawn_view_01:ev001
optional: true
- job: dawn_view_01:ev002
optional: true
script: script:
- ls -lrth * - ls -lrth *
- ls -lrth images/* - ls -lrth images/*
......
dawn_view_11:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -D
dawn_view_11:ev000:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11
dawn_view_11:ev001:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 1
dawn_view_11:ev002:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 2
dawn_view_11:ev003:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 3
dawn_view_11:ev004:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 4
view_11:
stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- job: compile
optional: false
- job: dawn_view_11:detector
optional: false
- job: dawn_view_11:ev001
optional: true
- job: dawn_view_11:ev002
optional: true
- job: dawn_view_11:ev003
optional: true
- job: dawn_view_11:ev004
optional: true
script:
- ls -lrth *
- ls -lrth images/*
dawn_view_12:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view12 -d scripts/view12 -D
view_12:
stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- ["dawn_view_12:detector"]
script:
- ls -lrth *
- ls -lrth images/*
dawn_view_13:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view13 -d scripts/view13 -D
view_13:
stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- ["dawn_view_13:detector"]
script:
- ls -lrth *
- ls -lrth images/*
dawn_view_14:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view14 -d scripts/view14 -D
view_14:
stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- ["dawn_view_14:detector"]
script:
- ls -lrth *
- ls -lrth images/*
dawn_view_15:detector:
extends: .views
script:
- ./bin/make_dawn_views -t view15 -d scripts/view15 -D
view_15:
stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- ["dawn_view_15:detector"]
script:
- ls -lrth *
- ls -lrth images/*
...@@ -2,15 +2,35 @@ dawn_view_02:detector: ...@@ -2,15 +2,35 @@ dawn_view_02:detector:
extends: .views extends: .views
script: script:
- ./bin/make_dawn_views -t view02 -d scripts/view2 -D - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
#dawn_view_02:ev001:
# extends: .views
# script:
# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_02:ev002: dawn_view_02:ev002:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
dawn_view_02:ev003:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3
view_02: view_02:
stage: test stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: needs:
- ["dawn_view_02:detector", "dawn_view_02:ev002"] - job: dawn_view_02:detector
optional: false
- job: dawn_view_02:ev002
optional: true
- job: dawn_view_02:ev003
optional: true
#- ["dawn_view_02:detector", "dawn_view_02:ev001", "dawn_view_02:ev002", "dawn_view_02:ev003"]
script: script:
- ls -lrth * - ls -lrth *
- ls -lrth images/* - ls -lrth images/*
......
...@@ -2,15 +2,27 @@ dawn_view_03:detector: ...@@ -2,15 +2,27 @@ dawn_view_03:detector:
extends: .views extends: .views
script: script:
- ./bin/make_dawn_views -t view02 -d scripts/view2 -D - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
#dawn_view_03:ev001:
# extends: .views
# script:
# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_03:ev002: dawn_view_03:ev002:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 - ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
view_03: view_03:
stage: test stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: needs:
- ["dawn_view_03:detector", "dawn_view_03:ev002"] - job: dawn_view_03:detector
optional: false
- job: dawn_view_03:ev002
optional: true
#- ["dawn_view_03:detector", "dawn_view_03:ev001", "dawn_view_03:ev002"]
script: script:
- ls -lrth * - ls -lrth *
- ls -lrth images/* - ls -lrth images/*
......
...@@ -2,15 +2,43 @@ dawn_view_06:detector: ...@@ -2,15 +2,43 @@ dawn_view_06:detector:
extends: .views extends: .views
script: script:
- ./bin/make_dawn_views -t view02 -d scripts/view2 -D - ./bin/make_dawn_views -t view02 -d scripts/view2 -D
#dawn_view_06:ev001:
# extends: .views
# script:
# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
dawn_view_06:ev002:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
dawn_view_06:ev003:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3
dawn_view_06:ev004: dawn_view_06:ev004:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view02_ev004 -d scripts/view2 -s 4 - ./bin/make_dawn_views -t view02_ev004 -d scripts/view2 -s 4
view_06: view_06:
stage: test stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: needs:
- ["dawn_view_06:detector", "dawn_view_06:ev004"] - job: dawn_view_06:detector
optional: false
- job: dawn_view_06:ev002
optional: true
- job: dawn_view_06:ev003
optional: true
- job: dawn_view_06:ev004
optional: true
#- ["dawn_view_06:detector", "dawn_view_06:ev001", "dawn_view_06:ev002", "dawn_view_06:ev003", "dawn_view_06:ev004"]
script: script:
- ls -lrth * - ls -lrth *
- ls -lrth images/* - ls -lrth images/*
......
dawn_view_07:detector: dawn_view_07:detector:
extends: .views extends: .views
script: script:
- ./bin/make_dawn_views -t view02 -d scripts/view2 -D - ./bin/make_dawn_views -t view07 -d scripts/view2 -D
dawn_view_07:ev002: dawn_view_07:ev002:
extends: .views extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script: script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2 - ./bin/make_dawn_views -t view07_ev002 -d scripts/view2 -s 2
dawn_view_07:ev003:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view07_ev003 -d scripts/view2 -s 3
view_07: view_07:
stage: test stage: test
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs: needs:
- ["dawn_view_07:detector", "dawn_view_07:ev002"] - job: dawn_view_07:detector
optional: false
- job: dawn_view_07:ev002
optional: true
- job: dawn_view_07:ev003
optional: true
script: script:
- ls -lrth * - ls -lrth *
- ls -lrth images/* - ls -lrth images/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment