#!/bin/csh -fx
# Generates BELD plots 

setenv INDIR  /work/MOD3APP/ezv/2020_NEI/BELD_6/12US1 
setenv iname  BELDv6.0_Norm_Area_12US1_RDS-2013-0013_MODIS_CDL_Canada.Beta.ncf 
set noglob # must use when variables contain asterisks

# This is necessary on RedHat 8
setenv PROJ_LIB /work/EMIS/python/miniforge3/envs/psemplot/share/proj

set psemplot = /work/EMIS/python/custom_packages

set species = `ncdump -h $INDIR/$iname | grep float | cut -d "(" -f1 | cut -d " " -f2`

echo $species

set species = ( MODIS_12 ) 
foreach s ( $species )
 
set oname = $iname:r.$s.png
set oname2 = $iname:r.$s.low_max.png

/work/EMIS/python/custom_packages/psemplot.py $INDIR/$iname $oname -t "BELD6 $s" -f ${s}_A \
         --vmax 30 -b 10 --ticks=5 --scale-label="percent" --cmap=viridis_r --hi-res --shape-file=/work/EMIS/users/mroark/test/plot/natural_earth_countries_states_counties_islands_and_coastlines_boundaries_geometries_only --shape-att=GEOID

#/work/EMIS/python/custom_packages/psemplot.py $INDIR/$iname $oname2 -t "BELD6 $s" -f ${s}_A \
#         --vmax 1 -b 10 --ticks=5 --scale-label="percent" --cmap=viridis_r --hi-res --shape-file=/work/EMIS/users/bte/shapes/usgs_na_2006.shp


end


exit
