Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:02

0001 #!/bin/bash 
0002 usage(){ cat << EOU
0003 elv.sh / emm.sh :  analysis of ELV/EMM scan metadata
0004 ======================================================
0005 
0006 NB emm.sh is a symbolic link to elv.sh so this single script
0007 handles both with mode switched based on the scriptstem being "emm" or "elv"
0008 
0009 Usage::
0010 
0011    ~/o/CSGOptiX/emm.sh jpg
0012    ~/o/CSGOptiX/elv.sh jpg
0013          ## write list of jpg paths in ascending render time order
0014 
0015    ~/o/CSGOptiX/emm.sh txt
0016    ~/o/CSGOptiX/elv.sh txt
0017          ## write TXT table with ordered render times 
0018 
0019    ~/o/CSGOptiX/emm.sh rst
0020    ~/o/CSGOptiX/elv.sh rst
0021          ## write RST table with ordered render times 
0022 
0023 
0024 Call stack::
0025 
0026     elv.sh OR emm.sh 
0027     ./cxr_overview.sh jstab
0028     source $SDIR/../bin/BASE_grab.sh $arg
0029     PYTHONPATH=../.. ${IPYTHON:-ipython} --pdb  ../ana/snap.py --  --globptn "$globptn" --refjpgpfx "$refjpgpfx" $SNAP_ARGS
0030 
0031 
0032 Check out the Panel geometry::
0033 
0034     EMM=9, ~/o/cx.sh 
0035 
0036 
0037 EOU
0038 }
0039 
0040 
0041 defarg="txt"
0042 arg=${1:-$defarg}
0043 
0044 if [ "$arg" == "ALL" ]; then
0045     types="jpg txt rst"
0046 else
0047     types=$arg
0048 fi 
0049 
0050 
0051 cd $(dirname $(realpath $BASH_SOURCE))
0052 scriptname=$(basename $BASH_SOURCE)   ## NB not with realpath as want to see name of symbolic link not the real path 
0053 scriptstem=${scriptname/.sh}
0054 
0055 MODE=$scriptstem
0056 
0057 SCAN=scan-$MODE
0058 LIM=512
0059 
0060 
0061 case $MODE in 
0062   elv) estem=cxr_view ;;
0063   emm) estem=cxr_overview ;;
0064 esac
0065 
0066 
0067 vars="0 BASH_SOURCE scriptname scriptstem MODE SCAN LIM arg defarg types vars"
0068 for var in $vars ; do printf "%20s :  %s \n" "$var" "${!var}" ; done 
0069 
0070 
0071 for typ in $types 
0072 do 
0073    outpath=/tmp/${MODE}_${typ}.txt
0074 
0075    export SNAP_estem=$estem
0076 
0077    export SNAP_outpath=$outpath
0078    export SNAP_selectmode=$MODE
0079    export SNAP_selectspec=all 
0080    export SNAP_dump=$typ
0081    export SNAP_LIMIT=$LIM  
0082 
0083    if [ "$MODE" == "elv" ]; then
0084        export SNAP_globptn='$BASE/cxr_view*elv*.jpg' 
0085        export SNAP_refjpgpfx="/env/presentation/cxr/cxr_view"
0086    elif [ "$MODE" == "emm" ]; then
0087        export SNAP_globptn='$BASE/cxr_overview*emm*.jpg' 
0088        export SNAP_refjpgpfx="/env/presentation/cxr/cxr_overview"
0089    fi
0090 
0091    SCAN=$SCAN  ./$estem.sh jstab    ## this runs snap.py 
0092 
0093    wc -l $outpath
0094    cat $outpath 
0095    wc -l $outpath
0096 done
0097 
0098