File indexing completed on 2025-01-18 09:15:51
0001
0002
0003
0004 export DAWN_PS_PREVIEWER="ls"
0005
0006 OUT_FILE=".DAWN_1.history"
0007
0008 function print_the_help {
0009 echo "USAGE: ${0} [-s <skip_events>] -d <dawn_run_dir> "
0010 echo " OPTIONS: "
0011 echo " --theta viewing angle"
0012 echo " --phi viewing angle"
0013 echo " -x targeted x coordinate position"
0014 echo " -y targeted y coordinate position"
0015 echo " -z targeted z coordinate position"
0016 echo " --mag magnification"
0017 echo " --draw draw style "
0018 echo " -d,--dawn-dir <dawn_run_dir> Directory with the .DAWN files and a generate script "
0019 exit
0020 }
0021
0022 function yes_or_no {
0023 while true; do
0024 read -p "$* [y/n]: " yn
0025 case $yn in
0026 [Yy]*) return 0 ;;
0027 [Nn]*) echo "No entered" ; return 1 ;;
0028 esac
0029 done
0030 }
0031
0032 if [[ $
0033 print_the_help
0034 exit
0035 fi
0036
0037 SKIP_EVENTS=0
0038 DETECTOR_ONLY=0
0039 FILE_TAG="view"
0040 DAWN_RUN_DIR="."
0041
0042
0043 POSITIONAL=()
0044 while [[ $
0045 do
0046 key="$1"
0047
0048 case $key in
0049 -h|--help)
0050 shift
0051 print_the_help
0052 ;;
0053 --theta)
0054 echo "updating theta angle to ${2}"
0055 sed -i '3d' ${DAWN_RUN_DIR}/${OUT_FILE}
0056 sed -i '3i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0057 shift
0058 shift
0059 ;;
0060 --phi)
0061 echo "updating phi angle to ${2}"
0062 sed -i '2d' ${DAWN_RUN_DIR}/${OUT_FILE}
0063 sed -i '2i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0064 shift
0065 shift
0066 ;;
0067 -x)
0068 echo "updating x coordinate to ${2}"
0069 sed -i '5d' ${DAWN_RUN_DIR}/${OUT_FILE}
0070 sed -i '5i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0071 shift
0072 shift
0073 ;;
0074 -y)
0075 echo "updating y coordinate to ${2}"
0076 sed -i '6d' ${DAWN_RUN_DIR}/${OUT_FILE}
0077 sed -i '6i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0078 shift
0079 shift
0080 ;;
0081 -z)
0082 echo "updating z coordinate to ${2}"
0083 sed -i '7d' ${DAWN_RUN_DIR}/${OUT_FILE}
0084 sed -i '7i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0085 shift
0086 shift
0087 ;;
0088 --mag)
0089 echo "updating magnification to ${2}"
0090 sed -i '8d' ${DAWN_RUN_DIR}/${OUT_FILE}
0091 sed -i '8i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0092 shift
0093 shift
0094 ;;
0095 --draw)
0096 echo "updating drawing to ${2}"
0097 sed -i '9d' ${DAWN_RUN_DIR}/${OUT_FILE}
0098 sed -i '9i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0099 shift
0100 shift
0101 ;;
0102 --light-phi)
0103 echo "updating light phi to ${2}"
0104 sed -i '18d' ${DAWN_RUN_DIR}/${OUT_FILE}
0105 sed -i '18i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0106 shift
0107 shift
0108 ;;
0109 --light-theta)
0110 echo "updating light theta to ${2}"
0111 sed -i '19d' ${DAWN_RUN_DIR}/${OUT_FILE}
0112 sed -i '19i'${2} ${DAWN_RUN_DIR}/${OUT_FILE}
0113 shift
0114 shift
0115 ;;
0116 -i|--input)
0117 OUT_FILE="$2"
0118 shift
0119 shift
0120 ;;
0121 -o|--ouput-dir)
0122 OUTPUT_DIR="$2"
0123 shift
0124 shift
0125 ;;
0126 -D|--detector-only)
0127 DETECTOR_ONLY=1
0128 shift
0129
0130 ;;
0131 -d|--dawn-dir)
0132 DAWN_RUN_DIR=$2
0133 shift
0134 shift
0135 ;;
0136 -t|--tag)
0137 FILE_TAG=$2
0138 shift
0139 shift
0140 ;;
0141 *)
0142
0143 echo "unknown option $1"
0144 print_the_help
0145 shift
0146 ;;
0147 esac
0148 done
0149 set -- "${POSITIONAL[@]}"