Skip to content

Commit

Permalink
modify filename to include first url's name and last datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfromearth committed Jul 5, 2024
1 parent dbf5575 commit c9103d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion podaac/merger/harmony/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def process_catalog(self, catalog: Catalog):
if len(items) == 0:
return result

# # --- Get granule filepaths (urls) ---
netcdf_urls: list[str] = _get_netcdf_urls(items)

# -- Process metadata --
bbox = []
granule_urls = []
Expand All @@ -85,7 +88,11 @@ def process_catalog(self, catalog: Catalog):

# -- Perform merging --
collection = self._get_item_source(items[0]).collection
filename = f'{collection}_merged.nc4'
first_granule_url = []
get_granule_url(items[0], first_granule_url)
first_url_name = Path(first_granule_url[0]).stem
f'{first_url_name}_{datetimes[1].isoformat()}_{collection}_merged.nc4'
filename = f'{collection}_{datetimes[0].isoformat()}-{datetimes[1].isoformat()}_merged.nc4'

with TemporaryDirectory() as temp_dir:
self.logger.info('Starting granule downloads')
Expand Down

0 comments on commit c9103d6

Please sign in to comment.