Skip to content

Commit

Permalink
Updates to the CLI to include the end-date (IMAP-Science-Operations-C…
Browse files Browse the repository at this point in the history
…enter#658)

* CLI updates

* remove print statements
  • Loading branch information
maxinelasp authored Jun 25, 2024
1 parent 2437799 commit c12487b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def __init__(
self.end_date = end_date
if not end_date:
self.end_date = start_date
print(f"Setting end time to start time: {start_date}")

self.version = version
self.upload_to_sdc = upload_to_sdc
Expand All @@ -278,9 +277,9 @@ def download_dependencies(self):
try:
# TODO: Validate dep dict
# TODO: determine what dependency information is optional
# TODO: Add in timestamps and descriptor to query
return_query = imap_data_access.query(
start_date=self.start_date,
end_date=self.end_date,
instrument=dependency["instrument"],
data_level=dependency["data_level"],
version=dependency["version"],
Expand All @@ -296,8 +295,12 @@ def download_dependencies(self):
f"This should never occur "
f"in normal processing."
)

file_list.append(imap_data_access.download(return_query[0]["file_path"]))
file_list.extend(
[
imap_data_access.download(query_return["file_path"])
for query_return in return_query
]
)
return file_list

def upload_products(self, products: list[str]):
Expand Down Expand Up @@ -459,7 +462,7 @@ def do_processing(self, dependencies):
products = [write_cdf(dataset) for dataset in datasets]

if self.data_level == "l1b":
if len(dependencies) < 1:
if len(dependencies) > 1:
raise ValueError(
f"Unexpected dependencies found for GLOWS L1B:"
f"{dependencies}. Expected at least one input dependency."
Expand Down

0 comments on commit c12487b

Please sign in to comment.