Commit 08467677 authored by Carl Schreck's avatar Carl Schreck

Automated Daily Commit - Sun Jun 7 12:00:24 EDT 2020

parent 45fc0c14
......@@ -16,9 +16,9 @@ import numpy as np
# These are some parameters that could be useful to have up top
year = 2020
month = 4
month = 5
first_day = 1
last_day = 6
last_day = 31
clobber = True
time_range = slice(f'{year}-{month:02}-{first_day:02}',
......@@ -32,7 +32,9 @@ cjs.tstamp('Downloading')
file_type = 'scaled'
file_name = f'prcp-{year}{month:02}-grd-{file_type}.nc'
in_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/prcp/{file_name}'
ftp_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
ftp_path = (f'ftp://ftp.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
web_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
download_err = cjs.download_file(ftp_path, in_path, clobber=clobber)
if download_err:
......
......@@ -31,7 +31,9 @@ cjs.tstamp('Downloading')
file_type = 'scaled'
file_name = f'prcp-{year}{month:02}-grd-{file_type}.nc'
in_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/prcp/{file_name}'
ftp_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
ftp_path = (f'ftp://ftp.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
web_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
download_err = cjs.download_file(ftp_path, in_path, clobber=False)
if download_err:
......
......@@ -15,7 +15,7 @@ import cjs # '~carl/lib/python'
cjs.tstamp('Here we go!')
# These are some parameters that could be useful to have up top
month = 4
month = 5
year = 2020
days_in_month = calendar.monthrange(year, month)[1]
time_range = slice(f'{year}-{month}-01', f'{year}-{month}-{days_in_month}')
......
......@@ -16,9 +16,9 @@ from datetime import datetime
# These are some parameters that could be useful to have up top
year = 2020
month = 4
first_day = 1
last_day = 30
month = 5
first_day = 6
last_day = 14
clobber = False
time_range = slice(f'{year}-{month:02}-{first_day:02}',
......@@ -32,7 +32,9 @@ cjs.tstamp('Downloading')
file_type = 'scaled'
file_name = f'tavg-{year}{month:02}-grd-{file_type}.nc'
in_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/tavg/{file_name}'
ftp_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
ftp_path = (f'ftp://ftp.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
web_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
download_err = cjs.download_file(ftp_path, in_path, clobber=clobber)
if download_err:
......
......@@ -27,7 +27,9 @@ cjs.tstamp('Downloading')
file_type = 'scaled'
file_name = f'tavg-{year}{month:02}-grd-{file_type}.nc'
in_path = f'{os.environ["DATA_DIR"]}/nclimgrid/beta/tavg/{file_name}'
ftp_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
ftp_path = (f'ftp://ftp.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
web_path = (f'https://www1.ncdc.noaa.gov/pub/data/daily-grids/beta/by-month/'
f'{year}/{month:02}/{file_name}')
download_err = cjs.download_file(ftp_path, in_path, clobber=False)
if download_err:
......@@ -43,7 +45,7 @@ for delta_days in [1, 5]:
first_days = np.arange(start_day, days_in_month - delta_days + 2, 1)
last_days = np.arange(start_day + delta_days - 1, days_in_month + 1, 1)
fig_path = f'figures/tave-anom-{delta_days}/',
fig_path = f'figures/tave-anom-{delta_days}/'
os.makedirs(fig_path, exist_ok=True)
old_files = glob.glob(f'{fig_path}/*')
for file in old_files:
......
......@@ -18,9 +18,9 @@ from datetime import datetime
# These are some parameters that could be useful to have up top
year = 2020
month = 4
first_day = 21
last_day = 30
month = 5
first_day = 6
last_day = 14
clobber = False
time_range = slice(f'{year}-{month:02}-{first_day:02}',
......@@ -100,9 +100,7 @@ for region in ['nhem', 'namer']:
levels=clevels, colors=['black'])
shp_name = 'ne_50m_admin_0_countries_lakes'
cjs.add_map(ax, shp_name, edgecolor=(0.2, 0.2, 0.2), linewidth=0.5,
facecolor='none', zorder=3)
cjs.add_map(ax)
cjs.tstamp('Add labels')
date_string = f'{calendar.month_name[month]} {first_day}-{last_day} {year}'
......
......@@ -33,9 +33,9 @@ ftp_path = (f'ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.dailyavgs/'
f'pressure/{file_name}')
download_err = cjs.download_file(ftp_path, in_path, clobber=clobber)
region = 'namer'
for delta_days in [1, 5]:
fig_path = f'figures/hgt500-{region}-{delta_days}/',
fig_path = f'figures/hgt500-{region}-{delta_days}/'
os.makedirs(fig_path, exist_ok=True)
old_files = glob.glob(f'{fig_path}/*')
for file in old_files:
......@@ -112,9 +112,7 @@ for delta_days in [1, 5]:
cont_plot = total_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=clevels, colors=['black'])
shp_name = 'ne_50m_admin_0_countries_lakes'
cjs.add_map(ax, shp_name, edgecolor=(0.2, 0.2, 0.2), linewidth=0.5,
facecolor='none', zorder=3)
cjs.add_map(ax)
cjs.tstamp('Add labels')
date_string = f'{calendar.month_name[month]} {first_day}-{last_day} {year}'
......
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