#!/bin/sh # -*- shell -*- # Survey all the CR* files in the current directory PNOISE=2.5 SNOISE=20 D2NOISE=200 TMP=summary.$$ BitCheck() { filelist=`ls $ii/CRAT* $ii/CR00* 2>/dev/null` if [ "$filelist" = "" ] then echo "ERR No source files found in $ii" echo "" Help fi echo ">>> First check file integrity" for jj in $filelist do verify -r $jj done } Cleanup() { echo -n ">>>>>> Delete working browse file? yes/[no] " read foo case $foo in [yY]*) rm $TMP ;; *) echo "Leaving $TMP in place" ;; esac } Cobalt() { echo ">>> Generating science data plots" lf_cobalt -a 10 -b 4095 -r $TMP } Compress() { wholelist="" echo ">>> Generate single browse file: $TMP" for ii in $dirname do wholelist="$wholelist $ii/CR*" done browse -u -v -f $TMP $wholelist } Help() { echo "Usage $0 [-h] [dir1] .. [dirn]" echo " performs extensive checks on all SSR files with name" echo " of form CRAT* and CR00* in current or named directories" exit 0 } Limits() { echo ">>> Check red/yellow limits on housekeeping" ar_limits_check -a -v -T $TMP } Singles() { echo ">>> Check singles noise levels" ar_singles_check -m $SNOISE -d2 $D2NOISE -v $TMP } Stats() { echo ">>> Check limits on cal signal noise" statistics -n 80 -t -r $TMP | emi_noise_filter -m $PNOISE -v } while [ "$1" != "" ] do case $1 in -h*) Help ;; *) dirname="$dirname $1" ;; esac shift done if [ "$dirname" = "" ] then dirname="." # If no arg given, use current directory fi for ii in $dirname do BitCheck # run verify on all files individually done Compress # meld the whole mess into one working file Stats # check the cal signal noise Limits # check the red/yellow limits Singles # check the singles rates Cobalt # histogram the science data Cleanup # be neat exit 0 ######################################################################## # Pod follows ######################################################################## =for html CRaTER -- Verify =head2 NAME B -- Extensive checks performed on SSR files =head2 USAGE Verify [-h] [dir_name] ... [dir_name] =head2 FLAGS -h prints full help message =head2 DESCRIPTION This shell script invokes a series of tests on files read back from the solid state recorder on LRO. These files are assumed to be named "CRAT*". The script searches for all such files in either the current directory or in those directories named on the command line. The tests are =over =item * Verify CCSDS header, packet length, etc. =item * Flag excess noise riding on the internal cal signal =item * Check housekeeping parameters against red & yellow limits =item * Check for excess simgles rates =item * Generate plots of the histogrammed science data. =back =head2 BUGS Really should allow passing a -v flag =head2 SEE ALSO =head4 High Level programs =head4 Low Level programs verify, statistics, ar_limits_check, ar_singles_check, lf_cobalt =head2 AUTHOR Bob Goeke =head2 RCS Information $Id: Verify,v 1.3 2008/11/24 18:41:20 goeke Exp goeke $ =cut ######################################################################## # history follows ######################################################################## # $Log: Verify,v $ # Revision 1.3 2008/11/24 18:41:20 goeke # Fix minor calling bugs in data naming # Added -T flag to limits_check # # Revision 1.2 2008/09/17 15:10:31 goeke # Fixed == bug # # Revision 1.1 2008/09/12 19:03:49 goeke # Initial revision #