#!/bin/csh -f #+ # OSIRIS library of scripts # # NAME # osirisNgroups - assuming UTR, set the number of groups # # SYNOPSIS # osirisNgroups spec|imag [Ngroups] # # DESCRIPTION # # If no arguments are given, the current value is displayed. # # Will reset itime to minimum if needed. # # ARGUMENTS # # Ngroups - number of groups # # OPTIONS # # EXAMPLES # (M)CDS-like => osirisNgroups imag 2 # UTR => osirisNgroups spec 16 # # ENVIRONMENT VARIABLES # # FILES # # SERVERS & KEYWORDS # # SCRIPTS CALLED # # EXIT STATUS # 0 - normal exit, no error # 1 - script aborted by an interrupt # 2 - syncheck error # 3 - error parsing command line input # other errors... # # # # Modification History: # 2018jul10 - jlyke: Original #------------------------------------------------------ # Boiler plate for "-h" support for command autohelp. if ("$1" == "-h") then help $0 exit $status endif # Boilerplate for syncheck. # Note that the boiler plate should be transparent for all usages, # but to make correct use of syncheck you will need to specify the # correct pattern. set noglob set CheckStatus = `syncheck -command $0 $* -pattern {text {int:1,1000}}` unset noglob if ("$CheckStatus" != "OK") then # help $0 exit 1 endif # End of help/syncheck boiler plate. set mode = $1 switch ($mode) case S*: case s*: set M = "s" set det = "spec" breaksw case I*: case i*: set M = "i" set det = "imag" breaksw default: osirisScriptMsg -T "${cmd} ${det}: Specified detector must be SPEC or IMAG - aborting." exit 1 breaksw endsw shift # $argv now shorter by one # print out sampmode if no other args if ($#argv == 0) then show -s o${M}ds -terse groups exit 0 endif set groups = $1 modify -s o${M}ds groups=$groups # Compare itime with tmin and reset if necessary. set itime = `osirisTint ${det}` set tmin = `osirisTmin ${det}` set diff = `math $itime - $tmin | grep "-"` #echo $diff $itime $tmin if ("$diff" != "") then ${M}tint $tmin endif exit