From 3c722d49da2ee30f754214c35dfc0bf239753093 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Tue, 2 Apr 2024 11:42:23 +0500 Subject: [PATCH] cli arg control for selecting graph --- python_scripts/arc_sst_anom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_scripts/arc_sst_anom.py b/python_scripts/arc_sst_anom.py index 505e317..de06e38 100644 --- a/python_scripts/arc_sst_anom.py +++ b/python_scripts/arc_sst_anom.py @@ -2,15 +2,17 @@ import json import matplotlib.pyplot as plt import numpy, pandas import requests +import sys sst_urls = { "world": "https://climatereanalyzer.org/clim/sst_daily/json/oisst2.1_world2_sst_day.json", "natlan": "https://climatereanalyzer.org/clim/sst_daily/json/oisst2.1_natlan1_sst_day.json" } +print(sys.argv[1]) start_range = 29 start_year = 1982 -res = requests.get(sst_urls['world']) +res = requests.get(sst_urls[list(sst_urls)[int(sys.argv[1])]]) data = json.loads(res.text) data = data[1:-3]