Commit 0aab5516 authored by Carl Schreck's avatar Carl Schreck
Browse files

Switched WPC surface plots

parent 9b177f0d
......@@ -22,8 +22,8 @@ bsub \
-o $LOG_FILE \
-e $ERR_FILE \
-q $QUEUE \
-b 11:00 \
-n 1 -W 1:00 \
-b 11:05 \
-sp 50 \
$BASE_DIR/run_v1.sh
......@@ -38,8 +38,8 @@ bsub \
-o $LOG_FILE \
-e $ERR_FILE \
-q $QUEUE \
-b 11:00 \
-n 1 -W 1:00 \
-b 11:05 \
-sp 50 \
$BASE_DIR/rmm.sh
......
......@@ -22,8 +22,13 @@ local_dir = f'{os.getenv("FTP_DIR")}/monitor/sfcplot/{day.strftime("%Y%m/")}'
if not os.path.exists(local_dir):
os.makedirs(local_dir)
filename = f'sfcplot_sm_{day.strftime("%Y%m%d")}.gif'
remote_path = f'https://www.wpc.ncep.noaa.gov/dailywxmap/htmlimages/{filename}'
filename = f'lrgnamsfcwbg_{day.strftime("%Y%m%d")}.gif'
remote_path = f'https://www.wpc.ncep.noaa.gov/sfc/lrgnamsfcwbg.gif'
local_path = f'{local_dir}{filename}'
cjs.download_file(remote_path, local_path, clobber=True)
filename = f'weather_{day.strftime("%Y%m%d")}.gif'
remote_path = f'https://www.wpc.ncep.noaa.gov/NationalForecastChart/staticmaps/noaad1.png'
local_path = f'{local_dir}{filename}'
cjs.download_file(remote_path, local_path, clobber=True)
......
......@@ -66,7 +66,7 @@ begin
latestFile = addfile( tmpPath + fileName + ".grib", "r" )
if( any( ismissing( latestFile ) ) ) then
system( "rm " + tmpPath + fileName + ".grib" )
system( "wget -nv -O " + tmpPath + fileName + " " + \\
system( "wget -nv -O " + tmpPath + fileName + ".grib " + \\
inPath + fileName )
delete(latestFile)
......
;******************************************************************************
; cd_string.ncl
; Carl Schreck (carl@atmos.albany.edu)
; Based on time_axis_labels (originally "tTick") by Arindam Chakraborty.
; Obtained from http://www.ncl.ucar.edu/Support/talk_archives/2007/0763.html
; September 2008
; Modified April 2009 by Carl Schreck (carl@atmos.albany.edu)
; Replaced "mod" function call on line 279 with modulus operator %
; Add default input string for ""
; Modified October 2010 by Carl Schreck (carl.schreck@noaa.gov)
; Add support for "day of year"
; Modified April 2011 by Carl Schreck (carl.schreck@noaa.gov)
; Now handles missing values without error messages, and removed "ChangeCase"
;******************************************************************************
undef("cd_string")
function cd_string( time[*]:numeric, inFormat:string )
;******************************************************************************
; Purpose: Convert a time into a string
;
; Arguments:
; time: The variable containing the values of time. This variable should
; have an attribute named "units".
;
; inFormat: (OPTIONAL) a string specifying the format of the tick labels.
; This string is parsed as follows: the '%' acts as
; the escape character. The single character after every
; '%' is formatted according to the rule:
; Y => 4-digit year (e.g., 2007).
; y => 2-digit year (e.g., 07).
; C => CAPITAL month abbreviation (e.g., JUN).
; c => Small month abbreviation (e.g., Jun).
; F => CAPITAL full month (e.g., JUNE).
; f => Small full month (e.g., June).
; N => 2-digit month (e.g., 06).
; n => 1 or 2 digit month (e.g., 6 for June, 12 for December).
; D => 2-digit day (e.g., 04).
; d => 1 or 2 digit day (e.g., 4)
; J => 3-digit day-of-year (e.g., 091)
; j => 1, 2, or 3 digit day-of-year (e.g., 4, 91, or 181)
; H => 2-digit hour (e.g., 09).
; h => 1 or 2 digit hour (e.g., 9 or 11).
; M => 2 digit minute (e.g., 08).
; m => 1 or 2 digit minute (e.g., 07 or 56).
; S => 2 digit second (e.g., 02).
; s => 1 or 2 digit second (e.g., 2 or 23).
; Any character at any other place in the format string
; is drawn as is.
; NOTE: a '%' can be drawn using "%%".
; In case Format is absent, a minimal algorithm exists
; which tries to determine the format string depending
; on the length and values of the date-time.
;
; If inFormat is "", it will default to "%H%M UTC %d %c %Y"
; e.g., 1800 UTC 4 Jul 1776
;
; Return value:
; a string represent the time(s) in the specified format
;
; Exmple 1:
; timeDouble = cd_inv_calendar( 1776, 07, 04, 18, 00, 00, "hours since 1800-01-01 00:00", 0 )
; print( (/ cd_string( timeDouble, "" ) /) )
; print( (/ cd_string( timeDouble, "%Y-%N-%D %H:%M:%S" ) /) )
;
; The above will output:
; (0) 1800 UTC 4 Jul 1776
; (0) 1776-07-04 18:00:00
;
;******************************************************************************
local ymdhms0, ymdhms1i, chFormat, months, fmonths, inside, stFormat
begin
if( inFormat.eq."" ) then
stFormat = "%H%M UTC %d %c %Y"
else
stFormat = inFormat
end if
months = (/"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)
fmonths = (/"","January","February","March","April","May","June","July","August","September","October","November","December"/)
; check input
if (.not. isatt(time,"units")) then
print("cd_string: The variable containing time values must have a 'units' attribute.")
return
end if
ymdhms0 = cd_calendar(time,0)
nt = dimsizes(time)
if (typeof(ymdhms0) .eq. "float") then
ymdhms1i = floattointeger(ymdhms0)
else
ymdhms1i = ymdhms0
end if
retVal = new(nt,"string")
chFormat = stringtochar(stFormat)
do i = 0, dimsizes(time)-1
retVal(i) = ""
inside = False
if( .not.ismissing(time(i)) ) then
doy = day_of_year( ymdhms1i(i,0), ymdhms1i(i,1), ymdhms1i(i,2) )
else
doy = default_fillvalue("integer")
end if
j = 0
do while(j .lt. dimsizes(chFormat))
if (chFormat(j) .eq. "%") then
inside = True
j = j + 1
end if
if (.not. inside) then
retVal(i) = retVal(i)+chFormat(j)
else
if (chFormat(j) .eq. "Y") then
retVal(i) = retVal(i)+sprinti("%04d",ymdhms1i(i,0))
inside = False
end if
if (chFormat(j) .eq. "y") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,0)%100)
inside = False
end if
if (chFormat(j) .eq. "C") then
if( .not.ismissing(time(i)) ) then
retVal(i) = retVal(i)+str_upper(months(ymdhms1i(i,1)))
else
retVal(i) = retVal(i)+default_fillvalue("integer")
end if
inside = False
end if
if (chFormat(j) .eq. "c") then
if( .not.ismissing(time(i)) ) then
retVal(i) = retVal(i)+months(ymdhms1i(i,1))
else
retVal(i) = retVal(i)+default_fillvalue("integer")
end if
inside = False
end if
if (chFormat(j) .eq. "F") then
if( .not.ismissing(time(i)) ) then
retVal(i) = retVal(i)+str_upper(fmonths(ymdhms1i(i,1)))
else
retVal(i) = retVal(i)+default_fillvalue("integer")
end if
inside = False
end if
if (chFormat(j) .eq. "f") then
if( .not.ismissing(time(i)) ) then
retVal(i) = retVal(i)+fmonths(ymdhms1i(i,1))
else
retVal(i) = retVal(i)+default_fillvalue("integer")
end if
inside = False
end if
if (chFormat(j) .eq. "N") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,1))
inside = False
end if
if (chFormat(j) .eq. "n") then
retVal(i) = retVal(i)+sprinti("%d",ymdhms1i(i,1))
inside = False
end if
if (chFormat(j) .eq. "D") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,2))
inside = False
end if
if (chFormat(j) .eq. "d") then
retVal(i) = retVal(i)+sprinti("%d",ymdhms1i(i,2))
inside = False
end if
if (chFormat(j) .eq. "J") then
retVal(i) = retVal(i)+sprinti("%03d",doy)
inside = False
end if
if (chFormat(j) .eq. "j") then
retVal(i) = retVal(i)+sprinti("%d",doy)
inside = False
end if
if (chFormat(j) .eq. "H") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,3))
inside = False
end if
if (chFormat(j) .eq. "h") then
retVal(i) = retVal(i)+sprinti("%d",ymdhms1i(i,3))
inside = False
end if
if (chFormat(j) .eq. "M") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,4))
inside = False
end if
if (chFormat(j) .eq. "m") then
retVal(i) = retVal(i)+sprinti("%d",ymdhms1i(i,4))
inside = False
end if
if (chFormat(j) .eq. "S") then
retVal(i) = retVal(i)+sprinti("%02d",ymdhms1i(i,5))
inside = False
end if
if (chFormat(j) .eq. "s") then
retVal(i) = retVal(i)+sprinti("%d",ymdhms1i(i,5))
inside = False
end if
if (chFormat(j) .eq. "%") then
retVal(i) = retVal(i)+"%"
inside = False
end if
end if
j = j + 1
end do
end do
return( retVal )
end
......@@ -41,7 +41,7 @@ do
do
for ALGO_NAME in orig cfs notc
do
for REGION in global west east pacific africa
for REGION in global west east pacific africa atlantic indonesia
do
if [ $LEVEL = $EMPTY ]; then
......
......@@ -79,7 +79,7 @@ mkdir -p $LOG_DIR
for varName in total anom sub_tropic delta
do
for region in global atlantic eastpac westpac southpac australia indian
for region in global atlantic_eqtr atlantic eastpac westpac southpac australia indian
do
for nAvg in 7 14 21
do
......
......@@ -38,6 +38,10 @@ echo waves
cp -r -v -f /home/carl/data/monitor/v2/waves/* ~/ftp/monitor/waves/
date
echo tcvitals
rsync -r /home/carl/data/monitor/v2/tcvitals/* ~/ftp/monitor/tcvitals/
date
endTime=`date +"%s"`
#elapseTime=$(($endTime-$startTime))
#ncl /home/carl/monitor/v2/prestage/time_log.ncl outFileName=\"$JOB_NAME\" \
......
......@@ -13,7 +13,7 @@ echo $NCARG_ROOT
cd /home/carl/monitor/v2/plotting
for NAVG in 1 3 5 7 10
for NAVG in 1 2 3 5 7 10
do
for WAVE_NAME in all low mjo kelvin er tc mtd sum
do
......
......@@ -19,6 +19,8 @@ date
date
ncl tcvitals_to_netcdf.ncl
date
ncl tcvitals_to_v4.ncl
date
endTime=`date +"%s"`
elapseTime=$(($endTime-$startTime))
......
......@@ -17,16 +17,16 @@ begin ; main
; These are some parameters that could be useful to have up top
if( .not.isvar("varName") ) then
varName = "uwnd"
varName = "olr"
end if
if( .not.isvar("level") ) then
level = "850"
level = ""
end if
if( .not.isvar("algoName") )
algoName = "cfs"
end if
if( .not.isvar("latBand") )
latBand = "cust"
latBand = "eqtr"
end if
varLevName = varName + level
print( algoName + " " + varLevName )
......@@ -37,14 +37,14 @@ begin ; main
plotDpi = 150
if( latBand.eq."south" ) then
minLat = -15
maxLat = -5
minLat = 5
maxLat = 15
else if( latBand.eq."eqtr" ) then
minLat = -5
maxLat = 5
else if( latBand.eq."north" ) then
minLat = 5
maxLat = 15
minLat = 25
maxLat = 35
else if( latBand.eq."north2" ) then
minLat = 15
maxLat = 25
......@@ -54,6 +54,10 @@ begin ; main
else if( latBand.eq."cust" ) then
minLat = 10
maxLat = 20
else if( latBand.eq."cent" ) then
minLat = 15
maxLat = 25
end if
end if
end if
end if
......@@ -133,8 +137,8 @@ begin ; main
todayTime = inFile->time@lastObsTime
timeUnits = inFile->time@units
; todayTime = cd_inv_calendar( 2017, 09, 04, 00, 00, 00, timeUnits, 0 )
minTime = cd_inv_calendar( 2018, 07, 15, 00, 00, 00, timeUnits, 0 )
maxTime = cd_inv_calendar( 2018, 09, 30, 00, 00, 00, timeUnits, 0 )
minTime = cd_inv_calendar( 2021, 06, 01, 00, 00, 00, timeUnits, 0 )
maxTime = cd_inv_calendar( 2021, 08, 03, 00, 00, 00, timeUnits, 0 )
; minTime = todayTime - 84
; maxTime = todayTime + 28
......@@ -184,8 +188,8 @@ begin ; main
res@gsnLeftString = res@gsnLeftString + " with TC removal"
end if
res@gsnRightString = lat_string(minLat) + " - " + lat_string(maxLat)
res@trXMinF = -090
res@trXMaxF = 270
res@trXMinF = -000
res@trXMaxF = 180
; res@gsnAddCyclic = True
res@lbLabelFontHeightF = 0.013
......
......@@ -25,10 +25,10 @@ begin ; main
; These are some parameters that could be useful to have up top
if( .not.isvar("varName") ) then
varName = "uShear"
varName = "olr"
end if
if( .not.isvar("waveName") ) then
waveName = "all"
waveName = "er"
end if
if( .not.isvar("level") ) then
level = ""
......@@ -37,7 +37,7 @@ begin ; main
algoName = "cfs"
end if
if( .not.isvar("region") )
region = "west"
region = "india"
end if
if( .not.isvar("nAvg") )
nAvg = 7
......@@ -82,6 +82,13 @@ begin ; main
minLon = -90
maxLon = 90
centerLon = 000
else if( region.eq."india" ) then
minLat = -00
maxLat = 40
minLon = -00
maxLon = 180
centerLon = 000
end if
end if
end if
end if
......@@ -156,7 +163,7 @@ begin ; main
time = inFile->time
lastObsInd = time@lastObsInd
midTime = cd_inv_calendar( 2018, 09, 07, 00, 00, 00, time@units, 0 )
midTime = cd_inv_calendar( 2021, 07, 14, 00, 00, 00, time@units, 0 )
lastObsInd = minind( abs(midTime-time) )
print_clock( "Opening the workstation" )
......
......@@ -20,7 +20,8 @@ begin ; main
varName = "anom" ; anom sub_tropic delta
end if
if( .not.isvar("region") )
region = "atlantic" ; atlantic, eastpac, westpac, southpac, australia, indian
region = "atlantic_eqtr" ; atlantic, eastpac, westpac, southpac, australia,
; indian, atlantic_eqtr
end if
if( .not.isvar("nAvg") )
nAvg = 7
......@@ -37,36 +38,49 @@ begin ; main
maxLat = 90
minLon = 0
maxLon = 360
centerLon = 180
elseif( region.eq."atlantic" ) then
minLat = 5
maxLat = 50
minLon = 260
maxLon = 350
centerLon = 180
elseif( region.eq."eastpac" ) then
minLat = -20
maxLat = 40
minLon = 160
maxLon = 280
centerLon = 180
elseif( region.eq."westpac" ) then
minLat = -00
maxLat = 40
minLon = 100
maxLon = 180
centerLon = 180
elseif( region.eq."southpac" ) then
minLat = -40
maxLat = 00
minLon = 140
maxLon = 220
centerLon = 180
elseif( region.eq."australia" ) then
minLat = -40
maxLat = 00
minLon = 090
maxLon = 170
centerLon = 180
elseif( region.eq."indian" ) then
minLat = -25
maxLat = 25
minLon = 30
maxLon = 130
centerLon = 180
elseif( region.eq."atlantic_eqtr" ) then
minLat = -40
maxLat = 40
minLon = -100
maxLon = 60
centerLon = 0
end if
if( varName.eq."total" ) then
......@@ -175,7 +189,7 @@ begin ; main
res@mpMaxLatF = maxLat
res@mpMinLonF = minLon
res@mpMaxLonF = maxLon
res@mpCenterLonF = 180
res@mpCenterLonF = centerLon
; res@mpGeophysicalLineColor = "slateblue"
; res@mpNationalLineColor = "slateblue"
; res@mpUSStateLineColor = "slateblue"
......@@ -190,7 +204,11 @@ begin ; main
; res@mpGridAndLimbOn = True
res@mpGridLatSpacingF = 10
res@mpGridLonSpacingF = 10
res@gsnMajorLonSpacing = 20
if( region.eq."atlantic_eqtr" ) then
res@gsnMajorLonSpacing = 30
else
res@gsnMajorLonSpacing = 20
end if
end if
......
......@@ -25,7 +25,7 @@ begin ; main
; These are some parameters that could be useful to have up top
if( .not.isvar("varName") ) then
varName = "olr"
varName = "pwat"
end if
if( .not.isvar("level") ) then
level = ""
......@@ -87,7 +87,7 @@ begin ; main
posIsGood = True
cnFillPalette = "colorbrewer_coldhot"
else if( ( isStrSubset( varLevName, "wnd200" ) ) \
.or.( isStrSubset( varLevName, "shear" ) ) ) then
.or.( isStrSubset( str_lower(varLevName), "shear" ) ) ) then
if( latBand.eq."wide" ) then
shdInt = 4
else
......@@ -200,7 +200,6 @@ begin ; main
res@gsnRightString = lat_string(minLat) + " - " + lat_string(maxLat)
res@trXMinF = 0
res@trXMaxF = 360
res@gsnAddCyclic = True
res@lbLabelFontHeightF = 0.013
resTick = True
......
......@@ -37,7 +37,7 @@ begin ; main
algoName = "cfs"
end if
if( .not.isvar("region") )
region = "global"
region = "indonesia"
end if
if( .not.isvar("nAvg") )
nAvg = 1
......@@ -86,6 +86,20 @@ begin ; main
minLon = -90
maxLon = 90
centerLon = 000
else if( region.eq."atlantic" ) then
minLat = -40
maxLat = 10
minLon = -140
maxLon = 80
centerLon = 000
else if( region.eq."indonesia" ) then
minLat = -10
maxLat = 10
minLon = 80
maxLon = 170
centerLon = 000
end if
end if
end if
end if
end if
......
......@@ -5,14 +5,14 @@ tempPath=/home/carl/monitor/data/v2/incoming/tcvitals
gfsOutFormat=$basePath/gfs_tcvitals_%Y.txt
gdasOutFormat=$basePath/gdas_tcvitals_%Y.txt
for daysAgo in {3..1}
for daysAgo in {10..1}
do
date --date="$daysAgo days ago"
echo GDAS $daysAgo
for HH in 00 06 12 18
do
gdasFtpFormat=https://www.nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.%Y%m%d/$HH/gdas.t"$HH"z.syndata.tcvitals.tm00
gdasFtpFormat=https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.%Y%m%d/$HH/atmos/gdas.t"$HH"z.syndata.tcvitals.tm00
gdasFtpPath=`date --date="$daysAgo days ago" +"$gdasFtpFormat"`
gdasOutPath=`date --date="$daysAgo days ago" +"$gdasOutFormat"`
wget --no-check-certificate -nv -N -nd -P $tempPath $gdasFtpPath
......@@ -24,7 +24,7 @@ do
for HH in 00 06 12 18
do
# gfsFtpFormat=ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.%Y%m%d$HH/gfs.t"$HH"z.syndata.tcvitals.tm00
gfsFtpFormat=https://www.nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.%Y%m%d/$HH/gfs.t"$HH"z.syndata.tcvitals.tm00
gfsFtpFormat=https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.%Y%m%d/$HH/atmos/gfs.t"$HH"z.syndata.tcvitals.tm00
gfsFtpPath=`date --date="$daysAgo days ago" +"$gfsFtpFormat"`
gfsOutPath=`date --date="$daysAgo days ago" +"$gfsOutFormat"`
wget --no-check-certificate -nv -N -nd -P $tempPath $gfsFtpPath
......
......@@ -36,11 +36,11 @@ begin ; main
time = new_time_coord( minTime, maxTime, 1 )
finalString = \
"https://www.ncei.noaa.gov/thredds/dodsC/OisstBase/NetCDF/AVHRR/" \
+ "%Y%N/avhrr-only-v2.%Y%N%D.nc"
"https://www.ncei.noaa.gov/thredds/dodsC/OisstBase/NetCDF/V2.1/AVHRR/" \
+ "%Y%N/oisst-avhrr-v02r01.%Y%N%D.nc"
prelimString = \
"https://www.ncei.noaa.gov/thredds/dodsC/OisstBase/NetCDF/AVHRR/" \
+ "%Y%N/avhrr-only-v2.%Y%N%D_preliminary.nc"
"https://www.ncei.noaa.gov/thredds/dodsC/OisstBase/NetCDF/V2.1/AVHRR/" \
+ "%Y%N/oisst-avhrr-v02r01.%Y%N%D_preliminary.nc"
finalPath = cd_string( time, finalString )
prelimPath = cd_string( time, prelimString )
......@@ -64,11 +64,11 @@ begin ; main
print_clock( "Reading anom" )
anom = short2flt( inFiles[:]->anom )
newTime = cd_convert(total&time, timeUnits)
nTime = dimsizes(total&time)
delete(total&time)
delete(anom&time)
total&time = newTime
anom&time = newTime
total&time = time(:nTime-1)
anom&time = time(:nTime-1)
print_clock( "Writing" )
outPath = "~/data/monitor/v2/sst/oisst.nc"
......
......@@ -9,12 +9,14 @@ echo $QUEUE
# Need to run both cfs_new_year and climo_cfs
#NCL_SCRIPT=cfs_new_year
NCL_SCRIPT=climo_cfs
#NCL_SCRIPT=cfs_trim_1800
NCL_DIR=`pwd`
LOG_DIR=$NCL_DIR/log
mkdir -p $LOG_DIR
#for varName in chi psi uwnd vwnd
for varName in pwat uShear vShear shear
#for varName in pwat uShear vShear shear
for varName in pwat
do
# for level in 850 200
for level in ""
......
......@@ -50,6 +50,9 @@ begin ; main