Commit 5531996b authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Tue Apr 3 00:00:20 EDT 2018

parent fd0dec41
......@@ -6,7 +6,8 @@ else
fi
echo $QUEUE
NCL_SCRIPT=histo2d
#NCL_SCRIPT=histo2d
NCL_SCRIPT=wave_meanvar
NCL_DIR=`pwd`
LOG_DIR=$NCL_DIR/log
mkdir -p $LOG_DIR
......
......@@ -10,58 +10,32 @@ load "$CJS_NCL_LIB/lib.cjs_graphics.ncl"
load "$CJS_NCL_LIB/lib.array.ncl"
load "$CJS_NCL_LIB/print_clock.ncl"
begin
print_clock( "Here we go!" )
; These are some parameters that could be useful to have up top
plotType = "png"
plotName = "figures/histo2d"
plotDpi = 200
fontHeightF = 0.02
function plotOneHisto( \
io_wks : graphic, \
i_hirsData : numeric, \
i_avhrrData : numeric, \
i_minLat : numeric, \
i_maxLat : numeric, \
i_res : logical \
)
begin ; plotOneHisto
; shdLevels = ispan(-7,7,1)
; shdLevels = -999
; shdLevels = 10^ispan(1,5,1)
shdLevels = 500 * 2^ispan(1,8,1)
minLon = -180
maxLon = 180
minLat = -30
maxLat = 30
centerLon = 180
fontHeightF = 0.03
print_clock( i_minLat + " ... " + i_maxLat )
timeUnits = "days since 1800-01-01 00:00:00"
minTime = cd_inv_calendar( 1979, 01, 01, 00, 0, 0, timeUnits, 0 )
maxTime = cd_inv_calendar( 2013, 12, 31, 18, 0, 0, timeUnits, 0 )
hirsBin = ispan( 50, 350, 2 )
avhrrBin = ispan( 50, 350, 2 )
hirsBin = ispan( 100, 350, 2 )
avhrrBin = ispan( 100, 350, 2 )
hirs1d = ndtooned( i_hirsData(:,{i_minLat:i_maxLat},:) )
avhrr1d = ndtooned( i_avhrrData(:,{i_minLat:i_maxLat},:) )
print_clock( "Reading the data" )
print_clock( "Reading AVHRR" )
inPath = "/home/carl/data/olr/compare/avhrr/olr.total.nc"
inFile = addfile( inPath, "r" )
avhrrData = lon_subset( inFile->olr({minTime:maxTime},{minLat:maxLat},:), \
minLon, maxLon )
print_clock( "Reading HIRS" )
inPath = "/home/carl/data/olr/compare/hirs/olr.total.nc"
inFile = addfile( inPath, "r" )
hirsData = lon_subset( inFile->olr({minTime:maxTime},{minLat:maxLat},:), \
minLon, maxLon )
print_clock( "Regridding" )
hirsRegrid = copy_Gridding( avhrrData, hirsData )
hirs1d = ndtooned( hirsRegrid )
avhrr1d = ndtooned( avhrrData )
copy_VarAtts( hirsData, hirs1d )
copy_VarAtts( avhrrData, avhrr1d )
copy_VarAtts( i_hirsData, hirs1d )
copy_VarAtts( i_avhrrData, avhrr1d )
hirsGood = ( hirs1d.ge.min(hirsBin) ).and.( hirs1d.le.max(hirsBin) )
avhrrGood = ( avhrr1d.ge.min(avhrrBin) ).and.( avhrr1d.le.max(avhrrBin) )
......@@ -72,7 +46,6 @@ begin
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnLeftString = ""
res@gsnRightString = ""
; ...standardize the font sizes
......@@ -99,8 +72,16 @@ begin
res@cnMissingValFillPattern = "SolidFill"
res@cnMissingValFillColor = "gray"
res@tiXAxisString = "HIRS"
res@tiYAxisString = "AVHRR"
if( i_res@tmXBLabelsOn ) then
res@tiXAxisString = "HIRS"
else
res@tiXAxisString = ""
end if
if( i_res@tmYLLabelsOn ) then
res@tiYAxisString = "AVHRR"
else
res@tiYAxisString = ""
end if
; ...set the contour levels
if( shdLevels(0).eq.-999 ) then
......@@ -114,7 +95,7 @@ begin
res@gsnSpreadColorEnd = 18
; ...labelbar resources
res@lbLabelBarOn = True
res@lbLabelBarOn = False
res@lbLabelAutoStride = True
res@lbOrientation = "Vertical"
res@lbTitlePosition = "Right"
......@@ -126,6 +107,51 @@ begin
res@plotPercent = False
res@setZeroToMissing = True
copy_VarAtts( i_res, res )
res@gsnLeftString = i_res@gsnLeftString \
+ lat_string(i_minLat) + " - " + lat_string(i_maxLat)
retVal = cjs_draw_hist2d( io_wks, hirs1d(goodInd), avhrr1d(goodInd), \
hirsBin, avhrrBin, res )
regRes = True
regRes@maxNumData = 1000
cjs_add_regline( io_wks, retVal, hirs1d(goodInd), avhrr1d(goodInd), regRes )
return(retVal)
end ; plotOneHisto
begin
print_clock( "Here we go!" )
; These are some parameters that could be useful to have up top
plotType = "png"
plotName = "figures/histo2d"
plotDpi = 200
fontHeightF = 0.02
timeUnits = "days since 1800-01-01 00:00:00"
minTime = cd_inv_calendar( 1979, 01, 01, 00, 0, 0, timeUnits, 0 )
maxTime = cd_inv_calendar( 2013, 12, 31, 18, 0, 0, timeUnits, 0 )
print_clock( "Reading the data" )
print_clock( "Reading AVHRR" )
inPath = "/home/carl/data/olr/compare/avhrr/olr.total.nc"
inFile = addfile( inPath, "r" )
avhrrData = inFile->olr({minTime:maxTime},:,:)
print_clock( "Reading HIRS" )
inPath = "/home/carl/data/olr/compare/hirs/olr.total.nc"
inFile = addfile( inPath, "r" )
hirsData = inFile->olr({minTime:maxTime},:,:)
print_clock( "Regridding" )
hirsRegrid = copy_Gridding( avhrrData, hirsData )
print_clock( "Drawing the plot" )
; ...allows png or gif to work
......@@ -139,16 +165,48 @@ begin
wks = gsn_open_wks( plotTypeLocal, plotName )
gsn_merge_colormaps( wks, "posneg_carl", "default" )
plot = cjs_draw_hist2d( wks, hirs1d(goodInd), avhrr1d(goodInd), \
hirsBin, avhrrBin, res )
regRes = True
regRes@maxNumData = 1000
cjs_add_regline( wks, plot, hirs1d(goodInd), avhrr1d(goodInd), True )
draw( plot )
frame( wks )
res = True
res@tmXBLabelsOn = False
res@tmYLLabelsOn = True
res@gsnLeftString = "a) "
plotA = plotOneHisto( wks, hirsRegrid, avhrrData, -90, 90, res )
res@tmYLLabelsOn = False
res@gsnLeftString = "b) "
plotB = plotOneHisto( wks, hirsRegrid, avhrrData, -40, -20, res )
res@gsnLeftString = "c) "
plotC = plotOneHisto( wks, hirsRegrid, avhrrData, -90, -40, res )
res@tmYLLabelsOn = True
res@tmXBLabelsOn = True
res@gsnLeftString = "d) "
plotD = plotOneHisto( wks, hirsRegrid, avhrrData, -20, 20, res )
res@tmYLLabelsOn = False
res@gsnLeftString = "e) "
plotE = plotOneHisto( wks, hirsRegrid, avhrrData, 20, 40, res )
res@gsnLeftString = "f) "
plotF = plotOneHisto( wks, hirsRegrid, avhrrData, 40, 90, res )
panRes = True
panRes@gsnPanelBottom = 0.05
panRes@gsnPanelRight = 0.95
panRes@gsnPanelYWhiteSpacePercent = 5
panRes@gsnPanelLabelBar = True
panRes@lbTitlePosition = "Right"
panRes@lbTitleDirection = "Across"
panRes@lbOrientation = "Horizontal"
panRes@lbTitleFontHeightF = fontHeightF * 0.8
panRes@lbLabelFontHeightF = fontHeightF * 0.8
; panRes@pmLabelBarOrthogonalPosF = fontHeightF * 2
; panRes@pmLabelBarHeightF = fontHeightF * 2
gsn_panel( wks, (/ plotA, plotB, plotC, plotD, plotE, plotF /), (/ 2, 3 /), \
panRes )
print_clock( "Convert the image, if necessary" )
delete(wks)
......
......@@ -43,6 +43,7 @@ begin ; main
plotVar = "low"
res = True
cntRes = True
res@fontHeightF = 0.013
res@cnLevels = ispan(-5,5,1) * 1
res@mpMinLatF = -30
res@mpMaxLatF = 30
......@@ -52,11 +53,13 @@ begin ; main
plotVar = "mjo"
res = True
res@fontHeightF = 0.013
cntRes = True
mjoPlot = draw_meanvar( wks, plotVar, res, cntRes )
plotVar = "kelvin"
res = True
res@fontHeightF = 0.013
cntRes = True
cntRes@cnLevels = ispan( 6, 20, 2 )
kelvinPlot = draw_meanvar( wks, plotVar, res, cntRes )
......@@ -64,22 +67,23 @@ begin ; main
plotVar = "er"
res = True
res@tmXBLabelsOn = True
res@fontHeightF = 0.013
cntRes = True
erPlot = draw_meanvar( wks, plotVar, res, cntRes )
; Customize panel
panRes = True
panRes@gsnPanelYWhiteSpacePercent = 5
panRes@gsnPanelBottom = 0.05
panRes@gsnPanelYWhiteSpacePercent = 10
panRes@gsnPanelBottom = 0.10
panRes@gsnPanelLabelBar = True
panRes@lbTitleString = "%"
panRes@lbTitlePosition = "Right"
panRes@lbTitleDirection = "Across"
panRes@lbOrientation = "Horizontal"
panRes@lbTitleFontHeightF = 0.03
panRes@lbLabelFontHeightF = 0.03
panRes@pmLabelBarOrthogonalPosF = 0.00
panRes@lbTitleFontHeightF = 0.02
panRes@lbLabelFontHeightF = 0.02
panRes@pmLabelBarOrthogonalPosF = -0.03
gsn_panel( wks, (/ lowPlot, mjoPlot, kelvinPlot, erPlot /), (/ 4, 1 /), panRes )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment