#!/bin/sh # # This script runs 'hdiff' on portions of self-test output for the ATMS SDR. # # Copyright 2013, University of Wisconsin Regents. # Licensed under GNU GPL v2. # Check arguments if [ $# -ne 2 ]; then echo "Usage: atms_sdr_compare.bash dir1 dir2" exit 1 fi # Get primary and secondary directory names dir1=$1 dir2=$2 test -d "$CSPP_SDR_HOME" || echo "ERROR: CSPP_SDR_HOME should be set" echo "Checking brightness temperature output..." cd $dir1 for fn in SATMS*.h5; do stem=$(echo $fn |cut -d 'e' -f 1) echo checking $fn for ds in /All_Data/ATMS-SDR_All/BeamTime \ /All_Data/ATMS-SDR_All/BrightnessTemperature \ /All_Data/ATMS-SDR_All/BrightnessTemperatureFactors \ /All_Data/ATMS-SDR_All/GainCalibration \ /All_Data/ATMS-SDR_All/InstrumentMode \ /All_Data/ATMS-SDR_All/NEdTCold \ /All_Data/ATMS-SDR_All/NEdTWarm do $CSPP_SDR_HOME/common/local/bin/h5diff $fn ../${dir2}/${stem}*cspp*h5 $ds \ || echo ERROR: $ds mismatch in $fn done done echo "Checking geolocation output..." for fn in GATMO*.h5; do stem=$(echo $fn |cut -d 'e' -f 1) echo checking $fn for ds in \ /All_Data/ATMS-SDR-GEO_All/BeamLatitude \ /All_Data/ATMS-SDR-GEO_All/BeamLongitude \ /All_Data/ATMS-SDR-GEO_All/Height \ /All_Data/ATMS-SDR-GEO_All/Latitude \ /All_Data/ATMS-SDR-GEO_All/Longitude \ /All_Data/ATMS-SDR-GEO_All/MidTime \ /All_Data/ATMS-SDR-GEO_All/SCPosition \ /All_Data/ATMS-SDR-GEO_All/SCVelocity \ /All_Data/ATMS-SDR-GEO_All/SatelliteAzimuthAngle \ /All_Data/ATMS-SDR-GEO_All/SatelliteRange \ /All_Data/ATMS-SDR-GEO_All/SatelliteZenithAngle \ /All_Data/ATMS-SDR-GEO_All/SolarAzimuthAngle \ /All_Data/ATMS-SDR-GEO_All/SolarZenithAngle \ /All_Data/ATMS-SDR-GEO_All/StartTime do $CSPP_SDR_HOME/common/local/bin/h5diff $fn ../${dir2}/${stem}*cspp*h5 $ds \ || echo ERROR: $ds mismatch in $fn done done echo "Done."