Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Carl Schreck
OLR CDR
Commits
5fbf5e9a
Commit
5fbf5e9a
authored
Jul 07, 2016
by
Carl Schreck
Browse files
Automated Nightly Commit - Thu Jul 7 00:00:17 EDT 2016
parent
2b72c220
Changes
6
Hide whitespace changes
Inline
Side-by-side
compare/bsub_ncl.sh
0 → 100755
View file @
5fbf5e9a
#!/bin/bash --login
if
[
-z
"
$1
"
]
;
then
QUEUE
=
`
pick_queue
`
else
QUEUE
=
$1
fi
echo
$QUEUE
NCL_SCRIPT
=
wave_meanvar
NCL_DIR
=
`
pwd
`
LOG_DIR
=
$NCL_DIR
/log
mkdir
-p
$LOG_DIR
JOB_NAME
=
$NCL_SCRIPT
echo
$JOB_NAME
`
date
`
LOG_FILE
=
$LOG_DIR
/
$JOB_NAME
.log
ERR_FILE
=
$LOG_DIR
/
$JOB_NAME
.err
NCL_OPTION
=
""
rm
$LOG_FILE
$ERR_FILE
bsub
\
-J
$JOB_NAME
\
-o
$LOG_FILE
\
-e
$ERR_FILE
\
-q
$QUEUE
\
-n
1
-W
3:00
\
-sp
75
\
~/template/run_ncl.sh
$NCL_DIR
$NCL_SCRIPT
"
$NCL_OPTION
"
compare/log/total_meanvar.err
0 → 100644
View file @
5fbf5e9a
compare/log/wave_meanvar.err
0 → 100644
View file @
5fbf5e9a
compare/sub.draw_meanvar.ncl
View file @
5fbf5e9a
...
...
@@ -7,6 +7,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load "/home/carl/projects/olr_cdr/compare/sub.calc_meanvar.ncl"
load "$CJS_NCL_LIB/lib.composites.ncl"
undef ( "draw_meanvar" )
...
...
@@ -18,6 +19,11 @@ function draw_meanvar( \
)
begin ; draw_meanvar
; These are some parameters that could be useful to have up top
nTests = 1000
pThresh = 0.95
calcDims = 0
if( ( i_plotVar.eq."mean" ).or.( i_plotVar.eq."variance" ) ) then
varName = "olr"
else
...
...
@@ -28,28 +34,42 @@ begin ; draw_meanvar
if( i_plotVar.eq."mean" ) then
fileName = "olr.total.nc"
units = "W m-2"
calcDims@operation = i_plotVar
else if( i_plotVar.eq."variance" ) then
fileName = "olr.anom.nc"
units = "(W m-2)^2"
calcDims@operation = i_plotVar
else
fileName = "olr.std.waves.nc"
units = "%"
calcDims@operation = "variance"
end if
end if
hirsPath = "/home/carl/data/olr/compare/hirs/" + fileName
avhrrPath = "/home/carl/data/olr/compare/avhrr/" + fileName
hirsData = calc_meanvar( hirsPath, varName, i_plotVar, minYear, maxYear )
avhrrData = calc_meanvar( avhrrPath, varName, i_plotVar, minYear, maxYear )
timeUnits = "days since 1800-01-01 00:00:00"
minTime = cd_inv_calendar( minYear, 01, 01, 00, 0, 0, timeUnits, 0 )
maxTime = cd_inv_calendar( maxYear, 12, 31, 18, 0, 0, timeUnits, 0 )
hirsFile = addfile( hirsPath, "r" )
hirsData = hirsFile->$varName$({minTime:maxTime},{-65:65},:)
avhrrFile = addfile( avhrrPath, "r" )
avhrrData = avhrrFile->$varName$({minTime:maxTime},{-65:65},:)
if( units.eq."%" ) then
hirsData = hirsData * 100
avhrrData = avhrrData * 100
end if
hirsRegrid = copy_Gridding( avhrrData, hirsData )
diffData = hirsRegrid
-
avhrrData
diffData =
bootstrap_diff(
hirsRegrid
,
avhrrData
, nTests, pThresh, calcDims )
copy_VarCoords( avhrrData, diffData )
if( i_plotVar.eq."mean" ) then
plotData = dim_avg_n_Wrap( hirsData, calcDims )
else
plotData = dim_variance_n_Wrap( hirsData, calcDims )
end if
if( units.eq."%" ) then
diffData = diffData * 100
plotData = plotData * 100
end if
; Customize base plot
res = True
...
...
@@ -64,6 +84,7 @@ begin ; draw_meanvar
res@cnFillPalette = "colorbrewer_coldhot"
res@pmLabelBarOrthogonalPosF = 0.4
res@cnMissingValFillColor = "gray80"
if( i_res ) then
copy_VarAtts( i_res, res )
...
...
@@ -82,9 +103,9 @@ begin ; draw_meanvar
end if
retVal = cjs_draw_shaded_map( io_wks, diffData, res )
cjs_add_contours( io_wks, retVal,
hirs
Data, cntRes )
cjs_add_contours( io_wks, retVal,
plot
Data, cntRes )
printMinMax(
hirs
Data, True )
printMinMax(
plot
Data, True )
printMinMax( diffData, True )
return(retVal)
...
...
compare/total_meanvar.ncl
View file @
5fbf5e9a
...
...
@@ -43,12 +43,12 @@ begin ; main
plotVar = "mean"
res = True
res@fontHeightF = 0.015
res@cnLevels := ispan(-5,5,1) *
2
res@cnLevels := ispan(-5,5,1) *
3
cntRes = True
meanPlot = draw_meanvar( wks, plotVar, res, cntRes )
plotVar = "variance"
res@cnLevels := ispan(-5,5,1) * 5
0
res@cnLevels := ispan(-5,5,1) *
7
5
cntRes = True
varPlot = draw_meanvar( wks, plotVar, res, cntRes )
...
...
@@ -65,6 +65,9 @@ begin ; main
system( "convert -trim -border 5x5 -bordercolor white " \
+ "+repage -density " + plotDpi + " " \\
+ plotName + ".eps " + plotName + "." + plotType )
if( .not.isStrSubset( plotType, "e" ) ) then
; system( "rm -f " + plotName + ".eps" )
end if
end if
...
...
compare/wk99_diff.ncl
View file @
5fbf5e9a
...
...
@@ -9,6 +9,7 @@
load "$CJS_NCL_LIB/lib.cjs_graphics.ncl"
load "$CJS_NCL_LIB/lib.array.ncl"
load "$CJS_NCL_LIB/lib.kf.ncl"
load "$CJS_NCL_LIB/lib.composites.ncl"
load "$CJS_NCL_LIB/print_clock.ncl"
...
...
@@ -21,6 +22,10 @@ begin ; main
plotDpi = 200
fontHeightF = 0.02
nTests = 10
pThresh = 0.95
calcDims = (/ 0, 1 /)
print_clock( "Reading hirs" )
inPath = "/home/carl/data/olr/compare/hirs/olr.wk99.nc"
...
...
@@ -30,6 +35,19 @@ begin ; main
hirsSymNorm = inFile->symNormPower({-20:20},:)
hirsAntiNorm = inFile->antiNormPower({-20:20},:)
hirsSymAll = inFile->symAllPower(:,:,{-20:20},:)
hirsAntiAll = inFile->antiAllPower(:,:,{-20:20},:)
hirsBack = conform( hirsSymAll, inFile->background({-20:20},:), (/ 2, 3 /) )
hirsSymAllLog = log10(hirsSymAll)
hirsAntiAllLog = log10(hirsAntiAll)
hirsSymAllNorm = hirsSymAll / hirsBack
hirsAntiAllNorm = hirsAntiAll / hirsBack
copy_VarMeta( hirsSymAll, hirsSymAllLog )
copy_VarMeta( hirsAntiAll, hirsAntiAllLog )
copy_VarMeta( hirsSymAll, hirsSymAllNorm )
copy_VarMeta( hirsAntiAll, hirsAntiAllNorm )
print_clock( "Reading avhrr" )
inPath = "/home/carl/data/olr/compare/avhrr/olr.wk99.nc"
inFile = addfile( inPath, "r" )
...
...
@@ -38,21 +56,33 @@ begin ; main
avhrrSymNorm = inFile->symNormPower({-20:20},:)
avhrrAntiNorm = inFile->antiNormPower({-20:20},:)
diffSymLog = hirsSymLog - avhrrSymLog
copy_VarCoords( hirsSymLog, diffSymLog )
avhrrSymAll = inFile->symAllPower(:,:,{-20:20},:)
avhrrAntiAll = inFile->antiAllPower(:,:,{-20:20},:)
avhrrBack = conform( avhrrSymAll, inFile->background({-20:20},:), (/ 2, 3 /) )
avhrrSymAllLog = log10(avhrrSymAll)
avhrrAntiAllLog = log10(avhrrAntiAll)
avhrrSymAllNorm = avhrrSymAll / avhrrBack
avhrrAntiAllNorm = avhrrAntiAll / avhrrBack
copy_VarMeta( avhrrSymAll, avhrrSymAllLog )
copy_VarMeta( avhrrAntiAll, avhrrAntiAllLog )
copy_VarMeta( avhrrSymAll, avhrrSymAllNorm )
copy_VarMeta( avhrrAntiAll, avhrrAntiAllNorm )
diffSymLog = bootstrap_diff( hirsSymAllLog, avhrrSymAllLog, \
nTests, pThresh, calcDims )
printMinMax( diffSymLog, True )
diffAntiLog = hirsAntiLog
-
avhrrAnti
Log
copy_VarCoords( hirsAntiLog, diffAntiLog
)
diffAntiLog =
bootstrap_diff(
hirsAnti
All
Log
,
avhrrAnti
AllLog, \
nTests, pThresh, calcDims
)
printMinMax( diffAntiLog, True )
diffSymNorm = hirsSymNorm
-
avhrrSymNorm
copy_VarCoords( hirsSymNorm, diffSymNorm
)
diffSymNorm =
bootstrap_diff(
hirsSym
All
Norm
,
avhrrSym
All
Norm
, \
nTests, pThresh, calcDims
)
printMinMax( diffSymNorm, True )
diffAntiNorm = hirsAntiNorm
-
avhrrAntiNorm
copy_VarCoords( hirsAntiNorm, diffAntiNorm
)
diffAntiNorm =
bootstrap_diff(
hirsAnti
All
Norm
,
avhrrAnti
All
Norm
, \
nTests, pThresh, calcDims
)
printMinMax( diffAntiNorm, True )
...
...
@@ -90,6 +120,7 @@ begin ; main
res@cnLevels = ispan( -5, 5, 1 ) * 0.02
res@gsnLeftString = "Log Anti-symmetric"
print_clock( res@gsnLeftString )
printVarSummary(diffAntiLog)
plotAntiLog = kf_draw( wks, diffAntiLog(freq|:,k|:), \
"None", False, True, res )
cjs_add_contours( wks, plotAntiLog, hirsAntiLog(freq|:,k|:), cntRes )
...
...
@@ -132,7 +163,7 @@ begin ; main
+ "+repage -density " + plotDpi + " " \\
+ plotName + ".eps " + plotName + "." + plotType )
if( .not.isStrSubset( plotType, "e" ) ) then
;
system( "rm -f " + plotName + ".eps" )
system( "rm -f " + plotName + ".eps" )
end if
end if
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment