File indexing completed on 2026-04-09 07:49:01
0001
0002
0003 usage(){ cat << EOU
0004 cxr_flight.sh
0005 ===============
0006
0007 TODO: compare this with bin/flight7.sh, consolidate and remove one of them
0008
0009 See also opticks/bin/flight.sh::
0010
0011 ./cxr_flight.sh
0012
0013 Before taking flight check a single render with eg::
0014
0015 ./cxr.sh
0016 ./cxr_overview.sh
0017
0018 Developments here need to follow cxr.sh to some extent.
0019 This requires the invoked script to set OPTICKS_OUTDIR to the
0020 directory with the jpg renders and to name the jpg smth_00000.jpg
0021 etc..
0022
0023 EOU
0024 }
0025
0026 msg="=== $0 :"
0027
0028 script=${SCRIPT:-cxr_overview}
0029 period=${PERIOD:-16}
0030 limit=${LIMIT:-1024}
0031 scale0=${SCALE0:-0.6}
0032 scale1=${SCALE1:-0.3}
0033 flight=${FLIGHT:-RoundaboutXY_XZ}
0034
0035 flightconfig="flight=$flight,ext=.jpg,scale0=$scale0,scale1=$scale1,framelimit=$limit,period=$period"
0036
0037 flight-cmd(){ cat << EOC
0038 source ./${script}.sh --flightconfig "$flightconfig" $*
0039 EOC
0040 }
0041
0042 flight-render-jpg()
0043 {
0044 local msg="=== $FUNCNAME :"
0045 pwd
0046
0047 local cmd=$(flight-cmd $*)
0048 echo $cmd
0049 eval $cmd
0050
0051 local rc=$?
0052 echo $msg rc $rc
0053 }
0054
0055 flight-make-mp4()
0056 {
0057 local msg="=== $FUNCNAME :"
0058 local jpg2mp4=$HOME/env/bin/ffmpeg_jpg_to_mp4.sh
0059 [ ! -x "$jpg2mp4" ] && echo $msg no jpg2mp4 $jpg2mp4 script && return 1
0060 pwd
0061 $jpg2mp4
0062 return 0
0063 }
0064
0065
0066 flight-render-jpg $*
0067
0068 echo $msg OPTICKS_OUTDIR $OPTICKS_OUTDIR
0069 cd $OPTICKS_OUTDIR
0070
0071 flight-make-mp4
0072
0073
0074