Commit 9ad7010d authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Fri Jan 4 00:00:27 EST 2019

parent 2620c958
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ibt_add_legend.ncl
; Carl Schreck (cjschrec@ncsu.edu)
; January 2019
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Description: Empty file to start NCL scripts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
undef ( "ibt_add_legend" )
procedure ibt_add_legend( \
io_wks [1] : graphic, \
io_plot [1] : graphic, \
i_tcRes [1] : logical \ ; ibtStartName, ibtEndName, ibtGenesis, \
; ibtMinTime, ibtMaxTime
)
begin ; ibt_add_legend
; These are some parameters that could be useful to have up top
lgRes = True
lgRes@lgLabelFontHeightF = 0.07
lgRes@lgLineColors = IBT_COLORS
lgRes@vpWidthF = 0.08
lgRes@vpHeightF = 0.10
lgRes@lgPerimFill = 0
lgRes@lgMonoDashIndex = True
if( isatt( i_tcRes, "gsLineThicknessF" ) ) then
lgRes@lgLineThicknessF = i_tcRes@gsLineThicknessF
else
lgRes@lgMonoLineThickness = False
lgRes@lgLineThicknesses = 1 + ispan( 0, dimsizes(IBT_COLORS)-1, 1 )*0.33
end if
io_plot@lgId = gsn_create_legend( io_wks, dimsizes(IBT_LABELS), \
IBT_LABELS, lgRes )
if( ( .not.isatt( i_tcRes, "lgJust" ) ) \
.or.i_tcRes@lgJust.eq."BottomRight" ) then
amRes = True
amRes@amParallelPosF = 1.0
amRes@amOrthogonalPosF = 0.0
amRes@amJust = "BottomRight"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."BottomLeft" ) then
amRes = True
amRes@amParallelPosF = 0.0
amRes@amOrthogonalPosF = 0.0
amRes@amJust = "BottomLeft"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."TopRight" ) then
amRes = True
amRes@amParallelPosF = 1.0
amRes@amOrthogonalPosF = 1.0
amRes@amJust = "TopRight"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."TopLeft" ) then
amRes = True
amRes@amParallelPosF = 0.0
amRes@amOrthogonalPosF = 1.0
amRes@amJust = "TopLeft"
amRes@amZone = 1
end if
io_plot@legend = gsn_add_annotation( io_plot, io_plot@lgId, amRes )
end; ibt_add_legend
......@@ -18,12 +18,6 @@ begin ; ibt_map_all_storms
; These are some parameters that could be useful to have up top
fontHeightF = 0.02
thresh = (/ 35, 64, 83, 96, 113, 137 /)
colors = (/ "gray50", "gray25", "cyan", "blue", "orange", "red", "magenta" /)
labels = " " \
+ (/ "TD", "TS", "Cat-1", "Cat-2", "Cat-3", "Cat-4", "Cat-5" /) \
+ " "
print_clock( "Reading TC data" )
if( i_inPath.eq."" ) then
inPath = IBT_DEFAULT_PATH
......@@ -56,8 +50,8 @@ begin ; ibt_map_all_storms
else
targetBasin = "All"
end if
if( isatt( i_tcRes, "thresh" ) ) then
minWind = i_tcRes@thresh
if( isatt( i_tcRes, "ibtThresh" ) ) then
minWind = i_tcRes@ibtThresh
else
minWind = -1
end if
......@@ -88,68 +82,23 @@ begin ; ibt_map_all_storms
targetBasin, i_tcRes )
end if
tcRes = i_tcRes
tcRes@lgLegendOn = False
do stormCounter = 0, dimsizes(name)-1
inTime = any( ( time(stormCounter,:).ge.minTime ) \
.and.( time(stormCounter,:).le.maxTime ) )
if( any( inBasin(stormCounter,:) ).and.inTime \
.and.( aboveMinWind(stormCounter) ) ) then
;print( id(stormCounter) + " " + name(stormCounter) + " " + minWind + " " + aboveMinWind(stormCounter) + " " + lmi(stormCounter) )
ibt_map_one_storm_preread( io_wks, io_plot, thresh, colors, \
ibt_map_one_storm_preread( io_wks, io_plot, \
name(stormCounter), time(stormCounter,:), lat(stormCounter,:), \
lon(stormCounter,:), wind(stormCounter,:), i_tcRes )
lon(stormCounter,:), wind(stormCounter,:), tcRes )
end if
end do
lgRes = True
lgRes@lgLabelFontHeightF = 0.07
lgRes@lgLineColors = colors
lgRes@vpWidthF = 0.08
lgRes@vpHeightF = 0.10
lgRes@lgPerimFill = 0
lgRes@lgMonoDashIndex = True
if( isatt( i_tcRes, "gsLineThicknessF" ) ) then
lgRes@lgLineThicknessF = i_tcRes@gsLineThicknessF
else
lgRes@lgMonoLineThickness = False
lgRes@lgLineThicknesses = 1 + ispan( 0, dimsizes(colors)-1, 1 )*0.33
end if
io_plot@lgId = gsn_create_legend( io_wks, dimsizes(labels), labels, lgRes )
if( ( .not.isatt( i_tcRes, "lgLegendOn" ) ).or.i_tcRes@lgLegendOn ) then
if( ( .not.isatt( i_tcRes, "lgJust" ) ) \
.or.i_tcRes@lgJust.eq."BottomRight" ) then
amRes = True
amRes@amParallelPosF = 1.0
amRes@amOrthogonalPosF = 0.0
amRes@amJust = "BottomRight"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."BottomLeft" ) then
amRes = True
amRes@amParallelPosF = 0.0
amRes@amOrthogonalPosF = 0.0
amRes@amJust = "BottomLeft"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."TopRight" ) then
amRes = True
amRes@amParallelPosF = 1.0
amRes@amOrthogonalPosF = 1.0
amRes@amJust = "TopRight"
amRes@amZone = 1
elseif( i_tcRes@lgJust.eq."TopLeft" ) then
amRes = True
amRes@amParallelPosF = 0.0
amRes@amOrthogonalPosF = 1.0
amRes@amJust = "TopLeft"
amRes@amZone = 1
end if
io_plot@legend = gsn_add_annotation( io_plot, io_plot@lgId, amRes )
ibt_add_legend( io_wks, io_plot, i_tcRes )
end if
end; ibt_map_all_storms
......
......@@ -9,8 +9,6 @@ undef ( "ibt_map_one_storm_preread" )
procedure ibt_map_one_storm_preread( \
io_wks [1] : graphic, \
io_plot [1] : graphic, \
i_thresh [*] : numeric, \
i_color [*] , \ ; should be 1 longer than thresh
i_idString [1] : string , \
i_time [*] : numeric, \
i_lat [*] : numeric, \
......@@ -165,13 +163,13 @@ end if
do fixCounter = firstFixInd, lastFixInd-1
; print( i_idString + " " + cd_string( i_time(fixCounter), "" ) \
; + " " + i_wind(fixCounter) )
colorInd = num( i_thresh.le.i_wind(fixCounter) )
colorInd = num( IBT_THRESH.le.i_wind(fixCounter) )
if( isatt( i_tcRes, "gsLineThicknessF" ) ) then
gsRes@gsLineThicknessF = i_tcRes@gsLineThicknessF
else
gsRes@gsLineThicknessF = 1+colorInd*0.33333
end if
gsRes@gsLineColor = i_color(colorInd)
gsRes@gsLineColor = IBT_COLORS(colorInd)
glowRes = gsRes
glowRes@gsLineColor = "white"
......@@ -187,6 +185,10 @@ end if
end do
end if
if( ( .not.isatt( i_tcRes, "lgLegendOn" ) ).or.i_tcRes@lgLegendOn ) then
ibt_add_legend( io_wks, io_plot, i_tcRes )
end if
end ; ibt_map_one_storm_preread
......@@ -207,8 +209,6 @@ begin
timeUnits = i_tcRes@timeUnits
end if
thresh = (/ 35, 64, 83, 96, 113, 137 /)
colors = (/ "gray50", "gray25", "cyan", "blue", "orange", "red", "magenta" /)
name = ibt_read_one_storm( i_path, timeUnits, i_targetSn )
time = name@time
time@units = timeUnits
......@@ -216,7 +216,7 @@ begin
lon = name@lon
wind = name@wind
ibt_map_one_storm_preread( io_wks, io_plot, thresh, colors, name, time, \
ibt_map_one_storm_preread( io_wks, io_plot, name, time, \
lat, lon, wind, i_tcRes )
end ; ibt_map_one_storm
......@@ -16,6 +16,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IBT_DEFAULT_PATH="~/data/ibtracs/hotel1/IBTrACS.ALL.hotel1.nc"
IBT_THRESH = (/ 35, 64, 83, 96, 113, 137 /)
IBT_COLORS = (/ "gray50", "gray25", "cyan", "blue", "orange", "red", "magenta" /)
IBT_LABELS = " " \
+ (/ "TD", "TS", "Cat-1", "Cat-2", "Cat-3", "Cat-4", "Cat-5" /) \
+ " "
if( .not.isdefined("copy_VarMeta") ) then
loadscript("$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl")
......@@ -32,6 +37,7 @@ load "$CJS_NCL_LIB/ibtracs4/ibt_read_track1d.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_read_genesis.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_genesis_hov.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_genesis_map.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_add_legend.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_map_one_storm.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_map_all_storms.ncl"
load "$CJS_NCL_LIB/ibtracs4/ibt_track_map.ncl"
......
Markdown is supported
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