loone-data-prep 0.1.8__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/PKG-INFO +1 -1
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/GEOGLOWS_LOONE_DATA_PREP.py +4 -4
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/LOONE_DATA_PREP.py +3 -3
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/utils.py +42 -1
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/PKG-INFO +1 -1
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/pyproject.toml +1 -1
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/LICENSE +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/README.md +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/__init__.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/data_analyses_fns.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/S65E_total.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/__init__.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/forecast_bias_correction.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/get_forecast_flows.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/get_inflows.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/get_outflows.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/hydro.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_level_data/__init__.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_level_data/get_all.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_level_data/hydro.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/__init__.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/get_inflows.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/get_lake_wq.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/wq.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/weather_data/__init__.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/weather_data/get_all.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/weather_data/weather.py +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/SOURCES.txt +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/dependency_links.txt +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/requires.txt +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/top_level.txt +0 -0
- {loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: loone_data_prep
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Prepare data to run the LOONE model.
|
|
5
5
|
Author-email: Osama Tarabih <osamatarabih@usf.edu>
|
|
6
6
|
Maintainer-email: Michael Souffront <msouffront@aquaveo.com>, James Dolinar <jdolinar@aquaveo.com>
|
|
@@ -26,9 +26,9 @@ D2_D = 30
|
|
|
26
26
|
St_Yr = 2008
|
|
27
27
|
St_M = 1
|
|
28
28
|
St_D = 1
|
|
29
|
-
En_Yr =
|
|
30
|
-
En_M =
|
|
31
|
-
En_D =
|
|
29
|
+
En_Yr = 2024
|
|
30
|
+
En_M = 9
|
|
31
|
+
En_D = 30
|
|
32
32
|
|
|
33
33
|
st_year = START_DATE.strftime("%Y")
|
|
34
34
|
st_month = START_DATE.strftime("%m")
|
|
@@ -577,7 +577,7 @@ def main(input_dir: str, output_dir: str, ensemble_number: str) -> None: # , hi
|
|
|
577
577
|
# Flow dataframe including Inflows, NetFlows, and Outflows (all in m3/day)
|
|
578
578
|
geoglows_flow_df.to_csv(f"{output_dir}/geoglows_flow_df_ens_{ensemble_number}_predicted.csv", index=False)
|
|
579
579
|
# Inflows (cmd)
|
|
580
|
-
LO_Inflows_BK.to_csv(f"{output_dir}/
|
|
580
|
+
LO_Inflows_BK.to_csv(f"{output_dir}/LO_Inflows_BK_forecast.csv", index=False)
|
|
581
581
|
# Outflows (cmd)
|
|
582
582
|
Outflows_consd.to_csv(f"{output_dir}/Outflows_consd.csv", index=False)
|
|
583
583
|
# NetFlows (cmd)
|
|
@@ -800,6 +800,7 @@ def nutrient_prediction(
|
|
|
800
800
|
|
|
801
801
|
def photo_period(
|
|
802
802
|
workspace: str,
|
|
803
|
+
file_name: str = "PhotoPeriod",
|
|
803
804
|
phi: float = 26.982052,
|
|
804
805
|
doy: np.ndarray = np.arange(1, 365),
|
|
805
806
|
verbose: bool = False,
|
|
@@ -808,6 +809,7 @@ def photo_period(
|
|
|
808
809
|
|
|
809
810
|
Args:
|
|
810
811
|
workspace (str): A path to the directory where the file will be generated.
|
|
812
|
+
file_name (str): The name of the file to be generated.
|
|
811
813
|
phi (float, optional): Latitude of the location. Defaults to 26.982052.
|
|
812
814
|
doy (np.ndarray, optional): An array holding the days of the year that you want the photo period for. Defaults to np.arange(1,365).
|
|
813
815
|
verbose (bool, optional): Print results of each computation. Defaults to False.
|
|
@@ -858,7 +860,7 @@ def photo_period(
|
|
|
858
860
|
photo_period_df["Data"] = P
|
|
859
861
|
|
|
860
862
|
photo_period_df.to_csv(
|
|
861
|
-
os.path.join(workspace, "
|
|
863
|
+
os.path.join(workspace, f"{file_name}.csv"), index=False
|
|
862
864
|
)
|
|
863
865
|
|
|
864
866
|
|
|
@@ -936,6 +938,45 @@ def dbhydro_data_is_latest(date_latest: str):
|
|
|
936
938
|
)
|
|
937
939
|
|
|
938
940
|
|
|
941
|
+
def get_synthetic_data(date_start: str, df: pd.DataFrame):
|
|
942
|
+
"""
|
|
943
|
+
Gets 15 days of synthetic NO and Chla data matching forecast start date.
|
|
944
|
+
|
|
945
|
+
Args:
|
|
946
|
+
date_start (str): The date to start the forecast
|
|
947
|
+
df (pd.DataFrame): The dataset containing NO or Chla data
|
|
948
|
+
|
|
949
|
+
Returns:
|
|
950
|
+
pd.DataFrame, pd.DataFrame: The updated NO or Chla dataset
|
|
951
|
+
"""
|
|
952
|
+
date_end = date_start + datetime.timedelta(days=15)
|
|
953
|
+
|
|
954
|
+
df['date'] = pd.to_datetime(df['date'], format='%Y-%m-%d')
|
|
955
|
+
# Extract the month and day from the 'date' column
|
|
956
|
+
df['month_day'] = df['date'].dt.strftime('%m-%d')
|
|
957
|
+
|
|
958
|
+
# Extract the month and day from date_start and date_end
|
|
959
|
+
start_month_day = date_start.strftime('%m-%d')
|
|
960
|
+
end_month_day = date_end.strftime('%m-%d')
|
|
961
|
+
|
|
962
|
+
# Filter the DataFrame to include only rows between date_start and date_end for all previous years
|
|
963
|
+
mask = (df['month_day'] >= start_month_day) & (df['month_day'] <= end_month_day)
|
|
964
|
+
filtered_data = df.loc[mask]
|
|
965
|
+
|
|
966
|
+
# Group by the month and day, then calculate the average for each group
|
|
967
|
+
average_values = filtered_data.groupby('month_day')['Data'].mean()
|
|
968
|
+
|
|
969
|
+
average_values_df = pd.DataFrame({
|
|
970
|
+
'date': pd.date_range(start=date_start, end=date_end),
|
|
971
|
+
'Data': average_values.values
|
|
972
|
+
})
|
|
973
|
+
|
|
974
|
+
df = pd.concat([df, average_values_df], ignore_index=True)
|
|
975
|
+
df.drop(columns=['month_day'], inplace=True)
|
|
976
|
+
|
|
977
|
+
return df
|
|
978
|
+
|
|
979
|
+
|
|
939
980
|
if __name__ == "__main__":
|
|
940
981
|
if sys.argv[1] == "get_dbkeys":
|
|
941
982
|
get_dbkeys(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: loone_data_prep
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Prepare data to run the LOONE model.
|
|
5
5
|
Author-email: Osama Tarabih <osamatarabih@usf.edu>
|
|
6
6
|
Maintainer-email: Michael Souffront <msouffront@aquaveo.com>, James Dolinar <jdolinar@aquaveo.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/flow_data/get_forecast_flows.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_level_data/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/__init__.py
RENAMED
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/get_inflows.py
RENAMED
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep/water_quality_data/get_lake_wq.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{loone_data_prep-0.1.8 → loone_data_prep-0.1.9}/loone_data_prep.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|