Skip to content

Commit

Permalink
Adding User input
Browse files Browse the repository at this point in the history
  • Loading branch information
Antsalacia committed Dec 9, 2024
1 parent 9ee52fb commit f0ae4f7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions earthspy/earthspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def set_query_parameters(
download_mode: str = "SM",
remove_splitboxes: bool = True,
verbose: bool = True,
label: str = None,
) -> None:
"""Define a set of parameters used for the API request.
Expand Down Expand Up @@ -145,6 +146,10 @@ def set_query_parameters(
:param verbose: Whether to print processing status or not, defaults
to True.
:type verbose: bool, optional
:param label: User input string put at the end of the file name,
defaults to None.
:type label: str, optionnal
"""

# set processing attributes
Expand Down Expand Up @@ -178,6 +183,9 @@ def set_query_parameters(

# find available data within user time range
self.get_available_data()

# set user input string for file name
self.label = label

# set download mode
if download_mode == "D":
Expand Down Expand Up @@ -934,7 +942,7 @@ def rename_output_files(self) -> None:
if self.download_mode == "D":
# build new file name
new_filename = (
f"{self.store_folder}/" + "{date}_{self.data_collection_str}.tif"
f"{self.store_folder}/" + "{date}_{self.data_collection_str}_{self.label}.tif"
)

# If SICE, don't rename file but move to date folder
Expand Down Expand Up @@ -964,7 +972,7 @@ def rename_output_files(self) -> None:
# build new file name
new_filename = (
f"{self.store_folder}/"
+ f"{date}_{self.data_collection_str}_{split_box_id}.tif"
+ f"{date}_{self.data_collection_str}_{split_box_id}_{self.label}.tif"
)

# if SICE, add split box id in all names and move to date folder
Expand Down

0 comments on commit f0ae4f7

Please sign in to comment.