Skip to content

Commit

Permalink
Merge pull request #57 from Hydrology-IFH:working_tree
Browse files Browse the repository at this point in the history
change TEMP.txt to TA.txt because of change in RoGeR toolbox
  • Loading branch information
maxschmi authored Aug 28, 2023
2 parents 2639dc7 + 59c1164 commit 6b4fb0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions weatherDB/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -4198,7 +4198,7 @@ def create_roger_ts(self, dir, period=(None, None),
agg_to="10 min", r_r0=r_r0, split_date=True,
nas_allowed=False,
add_t_min=add_t_min, add_t_max=add_t_max,
file_names={"N":"PREC.txt", "T":"TEMP.txt", "ET":"PET.txt"},
file_names={"N":"PREC.txt", "T":"TA.txt", "ET":"PET.txt"},
col_names={"N":"PREC", "ET":"PET",
"T":"TA", "T_min":"TA_min", "T_max":"TA_max",
"Jahr":"YYYY", "Monat":"MM", "Tag":"DD",
Expand Down Expand Up @@ -4284,12 +4284,12 @@ def create_ts(self, dir, period=(None, None),
The default is True.
file_names : dict, optional
A dictionary with the file names for the different parameters.
e.g.{"N":"PREC.txt", "T":"TEMP.txt", "ET":"ET.txt"}
e.g.{"N":"PREC.txt", "T":"TA.txt", "ET":"ET.txt"}
If an empty dictionary is given, then the standard names are used.
The default is {}.
col_names : dict, optional
A dictionary with the column names for the different parameters.
e.g.{"N":"PREC", "T":"TEMP", "ET":"ET", "Jahr":"YYYY", "Monat":"MM", "Tag":"DD", "Stunde":"HH", "Minute":"MN"}
e.g.{"N":"PREC", "T":"TA", "ET":"ET", "Jahr":"YYYY", "Monat":"MM", "Tag":"DD", "Stunde":"HH", "Minute":"MN"}
If an empty dictionary is given, then the standard names are used.
The default is {}.
keep_date_parts : bool, optional
Expand Down
20 changes: 10 additions & 10 deletions weatherDB/stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_meta(self,
meta[geom_col] = meta[geom_col].apply(wkt.loads)
meta = gpd.GeoDataFrame(
meta, crs="EPSG:" + srid, geometry=geom_col)

# strip whitespaces in string columns
for col in meta.columns[meta.dtypes == object]:
try:
Expand Down Expand Up @@ -884,7 +884,7 @@ def get_df(self, stids, **kwargs):
axis=1, inplace=True)
else:
df.columns = pd.MultiIndex.from_product(
[[stat.id], df.columns],
[[stat.id], df.columns],
names=["Station ID", "kind"])
if "df_all" in locals():
df_all = df_all.join(df)
Expand Down Expand Up @@ -1325,7 +1325,7 @@ def get_group_stations(self, stids="all", **kwargs):
def create_ts(self, dir, period=(None, None), kinds="best",
stids="all", agg_to="10 min", r_r0=None, split_date=False,
nas_allowed=True, add_na_share=False,
add_t_min=False, add_t_max=False,
add_t_min=False, add_t_max=False,
**kwargs):
"""Download and create the weather tables as csv files.
Expand Down Expand Up @@ -1473,7 +1473,7 @@ def create_ts(self, dir, period=(None, None), kinds="best",

def create_roger_ts(self, dir, period=(None, None), stids="all",
kind="best", r_r0=1,
add_t_min=False, add_t_max=False,
add_t_min=False, add_t_max=False,
do_toolbox_format=False, **kwargs):
"""Create the timeserie files for roger as csv.
Expand Down Expand Up @@ -1523,17 +1523,17 @@ def create_roger_ts(self, dir, period=(None, None), stids="all",
------
Warning
If there are NAs in the timeseries or the period got changed.
"""
"""
if do_toolbox_format:
return self.create_ts(
dir=dir, period=period, kinds=kind,
agg_to="10 min", r_r0=r_r0, stids=stids,
split_date=True, nas_allowed=False,
add_t_min=add_t_min, add_t_max=add_t_max,
file_names={"N":"PREC.txt", "T":"TEMP.txt", "ET":"PET.txt"},
col_names={"N":"PREC", "ET":"PET",
"T":"TA", "T_min":"TA_min", "T_max":"TA_max",
"Jahr":"YYYY", "Monat":"MM", "Tag":"DD",
add_t_min=add_t_min, add_t_max=add_t_max,
file_names={"N":"PREC.txt", "T":"TA.txt", "ET":"PET.txt"},
col_names={"N":"PREC", "ET":"PET",
"T":"TA", "T_min":"TA_min", "T_max":"TA_max",
"Jahr":"YYYY", "Monat":"MM", "Tag":"DD",
"Stunde":"hh", "Minute":"mm"},
add_meta=False,
keep_date_parts=True,
Expand Down

0 comments on commit 6b4fb0e

Please sign in to comment.