Commit c2e472ff authored by Carl Schreck's avatar Carl Schreck

Fixing arguments in ibtracs_monthly_monitor.py

parent 59bf558e
......@@ -8,7 +8,7 @@ __license__ = "BSD-3.0"
import cjs # '~carl/lib-py'
import ibtracs # '~carl/lib-py'
from datetime import datetime
import argparser
import argparse
import numpy as np
import pandas as pd
import calendar
......@@ -21,10 +21,10 @@ parser = argparse.ArgumentParser()
parser.add_argument('--year', default=datetime.today().year)
parser.add_argument('--month', default=(datetime.today().month - 1))
args = parser.parse_args()
end_year = args.end_year
end_month = args.end_month
end_year = int(args.year)
end_month = int(args.month)
do_ytd = False
do_ytd = True
if do_ytd:
months = range(1, end_month + 1)
else:
......
......@@ -18,9 +18,9 @@ import numpy as np
# These are some parameters that could be useful to have up top
year = 2019
month = 11
first_day = 23
last_day = 29
month = 12
first_day = 2
last_day = 8
clobber = False
time_range = slice(f'{year}-{month:02}-{first_day:02}',
......
......@@ -22,10 +22,11 @@ cjs.tstamp('Here we go!')
year = 2019
month = 12
days_in_month = calendar.monthrange(year, month)[1]
start_day = 15
delta_days = 5
first_days = np.arange(1, days_in_month - delta_days + 2, 1)
last_days = np.arange(delta_days, days_in_month + 1, 1)
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)
cjs.tstamp('Downloading')
file_type = 'scaled'
......@@ -112,7 +113,7 @@ for first_day, last_day in zip(first_days, last_days):
cjs.tstamp('Save figure')
plt.tight_layout()
plt.savefig(f'figures/prcp-pon-{year}-{month:02}{first_day:02}'
plt.savefig(f'figures/prcp-pon/prcp-pon-{year}-{month:02}{first_day:02}'
f'-{month:02}{last_day:02}.png', dpi=200)
# plt.show()
......
......@@ -19,9 +19,9 @@ from datetime import datetime
# These are some parameters that could be useful to have up top
# mpl.use('Agg')
year = 2019
month = 11
first_day = 20
last_day = 29
month = 12
first_day = 27
last_day = 31
clobber = False
time_range = slice(f'{year}-{month:02}-{first_day:02}',
......
......@@ -23,9 +23,10 @@ year = 2019
month = 12
days_in_month = calendar.monthrange(year, month)[1]
delta_days = 5
start_day = 15
first_days = np.arange(1, days_in_month - delta_days + 2, 1)
last_days = np.arange(delta_days, days_in_month + 1, 1)
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)
cjs.tstamp('Downloading')
file_type = 'scaled'
......@@ -109,7 +110,7 @@ for first_day, last_day in zip(first_days, last_days):
cjs.tstamp('Save figure')
plt.tight_layout()
plt.savefig(f'figures/tave-anom-{year}-{month:02}{first_day:02}'
plt.savefig(f'figures/tave-anom/tave-anom-{year}-{month:02}{first_day:02}'
f'-{month:02}{last_day:02}.png', dpi=200)
# plt.show()
plt.close()
......
......@@ -19,10 +19,10 @@ from datetime import datetime
# These are some parameters that could be useful to have up top
year = 2019
month = 11
first_day = 16
last_day = 22
clobber = False
month = 12
first_day = 27
last_day = 31
clobber = True
time_range = slice(f'{year}-{month:02}-{first_day:02}',
f'{year}-{month:02}-{last_day:02}')
......
......@@ -24,10 +24,11 @@ year = 2019
month = 12
days_in_month = calendar.monthrange(year, month)[1]
delta_days = 5
start_day = 15
clobber = False
first_days = np.arange(1, days_in_month - delta_days + 2, 1)
last_days = np.arange(delta_days, days_in_month + 1, 1)
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)
cjs.tstamp('Downloading')
file_name = f'hgt.{year}.nc'
......@@ -132,7 +133,8 @@ for first_day, last_day in zip(first_days, last_days):
cjs.tstamp('Save figure')
# plt.tight_layout()
plt.savefig(f'figures/hgt500-{region}-{year}-{month:02}{first_day:02}'
plt.savefig(f'figures/hgt500-{region}/'
f'hgt500-{region}-{year}-{month:02}{first_day:02}'
f'-{month:02}{last_day:02}.png', dpi=200)
# plt.show()
# plt.close()
......
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