Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding User input #121

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 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(
remove_splitboxes: bool = True,
verbose: bool = True,
raster_compression: str = None,
label: str = None,
) -> None:
"""Define a set of parameters used for the API request.

Expand Down Expand Up @@ -146,10 +147,13 @@ def set_query_parameters(
to True.
:type verbose: bool, optional


:param raster_compression: Raster compression to apply following methods
available in rasterio, defaults to None.
:type raster_compression: Union[None, str], 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 @@ -186,6 +190,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 @@ -1081,7 +1088,7 @@ def merge_rasters(self) -> None:
# and add download method name (SM)
date_output_filename = date_response_files[0].replace(
"_0.tif",
"_SM_mosaic.tif",
f"_SM_mosaic_{self.label}.tif",
)

# open files to merge
Expand Down
Loading