Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Reference Detector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
EIC
detectors
Reference Detector
Commits
dc92b849
Commit
dc92b849
authored
4 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
modified: scripts/view14/generate_eps
new file: scripts/view15/generate_eps
parent
182291a5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!70
Add optional event views
Pipeline
#9139
passed
4 years ago
Stage: config
Stage: build
Stage: docs
Stage: test
Stage: finalize
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/view14/generate_eps
+19
-19
19 additions, 19 deletions
scripts/view14/generate_eps
scripts/view15/generate_eps
+166
-0
166 additions, 0 deletions
scripts/view15/generate_eps
with
185 additions
and
19 deletions
scripts/view14/generate_eps
+
19
−
19
View file @
dc92b849
#!/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
{
...
...
This diff is collapsed.
Click to expand it.
scripts/view15/generate_eps
0 → 100755
+
166
−
0
View file @
dc92b849
#!/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).
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment