Warning, /epic/scripts/view11/generate_eps is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env bash
0002
0003 #trignometry
0004 sin ()
0005 {
0006 echo "scale=5;s($1)" | bc -l
0007 }
0008
0009 cos ()
0010 {
0011 echo "scale=5;c($1)" | bc -l
0012 }
0013
0014 tan ()
0015 {
0016 echo "scale=5;s($1)/c($1)" | bc -l
0017 }
0018
0019 #export DAWN_PS_PREVIEWER="derp"
0020
0021 function print_the_help {
0022 echo "USAGE: $0 <PRIM_FILE> "
0023 echo " OPTIONS: "
0024 echo " -t,--tag filename tag (default: view1)"
0025 exit
0026 }
0027
0028 FILE_TAG="view11"
0029 INPUT_FILE="g4_0000.prim"
0030
0031
0032 POSITIONAL=()
0033 while [[ $# -gt 0 ]]
0034 do
0035 key="$1"
0036
0037 case $key in
0038 -h|--help)
0039 shift # past argument
0040 print_the_help
0041 ;;
0042 -t|--tag)
0043 FILE_TAG="$2"
0044 shift # past argument
0045 shift # past value
0046 ;;
0047 -i|--input)
0048 INPUT_FILE="$2"
0049 shift # past argument
0050 shift # past value
0051 ;;
0052 *) # unknown option
0053 #POSITIONAL+=("$1") # save it in an array for later
0054 echo "unknown option $1"
0055 print_the_help
0056 shift # past argument
0057 ;;
0058 esac
0059 done
0060 set -- "${POSITIONAL[@]}" # restore positional parameters
0061
0062 echo "view11 produces a series of slightly rotated XY slices a different z locations. Along beamline"
0063
0064 #dawncut 1 0 0 100 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
0065 #dawncut -1 0 0 100 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
0066 #cp ${INPUT_FILE} ${FILE_TAG}.prim
0067
0068 dawncut 1 0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
0069 dawncut -1 0 0.01666 200 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
0070 dawn -d ${FILE_TAG}.prim
0071 ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
0072 gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
0073 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0074 -f ${FILE_TAG}_full.pdf
0075 pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox
0076
0077
0078 dawncut 1 0 -0.01666 200 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
0079 dawncut -1 0 0.01666 200 ${FILE_TAG}a_temp0.prim ${FILE_TAG}a.prim
0080 dawn -d ${FILE_TAG}a.prim
0081 ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
0082 gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
0083 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0084 -f ${FILE_TAG}a_full.pdf
0085 pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox