#!/bin/sh # # This script runs 'h5diff' on portions of self-test output for the # the CSPP VIIRS ATMOS EDR software. # # Copyright 2024, University of Wisconsin Regents. # Licensed under GNU GPL v2. # Check arguments if [ $# -ne 2 ]; then echo "Usage: viirs_atms_compare.bash dir1 dir2" exit 1 fi # Get primary and secondary directory names dir1=$1 dir2=$2 test -d "$CSPP_VIIRS_ATMOS_HOME" || echo "ERROR: CSPP_VIIRS_ATMOS_HOME should be set" #export PATH=$CSPP_VIIRS_ATMOS_HOME/libexec/bin/:$PATH echo " " echo "Comparing Aerosol Detection Product outputs..." cd $dir1 for fn in JRR-ADP*.nc; do # stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /Dust \ /Smoke do h5diff -c $fn ../${dir2}/${stem}*.nc $ds done done echo " " echo "Comparing Aerosol Optical Depth product outputs..." for fn in JRR-AOD*.nc; do stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /AOD550 do h5diff -p .10 -c $fn ../${dir2}/${stem}*.nc $ds done done echo " " echo "Comparing Cloud Mask product outputs..." for fn in JRR-CloudMask*.nc; do stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /CloudMask do h5diff -c $fn ../${dir2}/${stem}*.nc $ds done done echo " " echo "Comparing Cloud Height product outputs..." for fn in JRR-CloudHeight*.nc; do stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /CldTopHght \ /CldTopTemp do h5diff -p .10 -c $fn ../${dir2}/${stem}*.nc $ds done done echo " " echo "Comparing Cloud Phase product outputs..." for fn in JRR-CloudPhase*.nc; do stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /CloudPhase \ /CloudType do h5diff -c $fn ../${dir2}/${stem}*.nc $ds done done echo " " echo "Comparing Volcanic Ash product outputs..." for fn in JRR-VolcanicAsh*.nc; do stem=$(echo $fn |cut -d '_' -f 1-4) echo checking $fn for ds in /AshConfidence \ /AshTopTemp \ /AshTopHeight do h5diff -p .10 -c $fn ../${dir2}/${stem}*.nc $ds done done echo "Done."