Skip to content

Commit

Permalink
Update noaa_forecast.py (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
David P. Chassin authored Sep 5, 2024
1 parent 25682dc commit 81ffbec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/noaa_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
float_format = "%.1f"
date_format = "%Y-%m-%d %H:%M:%S"
max_retries = 5
position = None

def getforecast(lat,lon):
"""Get NOAA location"""
Expand Down Expand Up @@ -174,7 +175,7 @@ def writeglm(data, glm=sys.stdout, name=None, csv=None,download_now=True):
glm.write("}\n")
data.columns = list(map(lambda x:x.split('[')[0],data.columns))
glm.write("module tape;\n")
glm.write("#define NOAA_FORECAST_TIMEZONE=${SHELL gridlabd timezone local}\n")
glm.write(f"#define NOAA_FORECAST_TIMEZONE=${{SHELL gridlabd timezone {','.join(position)} -f=TZSPEC}}\n")
glm.write(f"#define NOAA_FORECAST_STARTTIME={data.index.min().isoformat('T')}\n")
glm.write(f"#define NOAA_FORECAST_STOPTIME={data.index.max().isoformat('T')}\n")
glm.write("object forecast\n{\n")
Expand Down Expand Up @@ -207,7 +208,6 @@ def syntax(code=0):
else:
print(f"Syntax: {os.path.basename(sys.argv[0]).replace('.py','')} -p -position=LAT,LON [-i|--interpolate=TIME|METHOD] [-g|--glm=GLMNAME] [-n|--name=OBJECTNAME] [-c|--csv=CSV] [--test] [-h|--help|help]")
exit(code)
position = None
glm = None
name = None
csv = None
Expand Down

0 comments on commit 81ffbec

Please sign in to comment.