Skip to content

Commit aebd818

Browse files
author
Stepheny Perez
authored
Merge pull request #140 from podaac/release/1.14.0
Release/1.14.0
2 parents f4e9f51 + 5daf6e7 commit aebd818

5 files changed

+12
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

6+
## [1.14.0]
7+
### Added
8+
- Added support for wildcard search patterns in podaac-data-downloader when executed with the -gr option (i.e. search/download by CMR Granule Ur/Id). Also, added usage details to Downloader.md to describe this new feature [138](https://github.com/podaac/data-subscriber/pull/138).
9+
610
## 1.13.1
711
### Fixed
812
- Fixed an issue where a required library wasn't being included in the installation.

Downloader.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ optional arguments:
3232
-e EXTENSIONS, --extensions EXTENSIONS
3333
Regexps of extensions of products to download. Default is [.nc, .h5, .zip, .tar.gz, .tiff]
3434
-gr GRANULENAME, --granule-name GRANULENAME
35-
Flag to download specific granule from a collection. This parameter can only be used if you know the granule name. Only one granule name can be supplied
35+
Flag to download specific granule from a collection. This parameter can only be used if you know the granule name. Only one granule name can be supplied. Supports wildcard search patterns allowing the user to identify multiple granules for download by using `?` for single- and `*` for multi-character expansion.
3636
--process PROCESS_CMD
3737
Processing command to run on each downloaded file (e.g., compression). Can be specified multiple times.
3838
--version Display script version information and exit.
@@ -131,6 +131,7 @@ The `-gr` option works by taking the file name, removing the suffix and searchin
131131

132132
Because of this behavior, granules without data suffixes and granules where the the UR does not directly follow this convention may not work as anticipated. We will be adding the ability to download by granuleUR in a future enhancement.
133133

134+
The -gr option supports wildcard search patterns (using `?` for single- and `*` for multi-character expansion) to select and download multiple granules based on the filename pattern. This feature is supported through wildcard search functionality provided through CMR, which is described in the [CMR Search API documentation](https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#parameter-options).
134135

135136
### Download data by cycle
136137

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "podaac-data-subscriber"
3-
version = "1.13.1"
3+
version = "1.14.0"
44
description = "PO.DAAC Data Subscriber Command Line Tool"
55
authors = ["PO.DAAC <[email protected]>"]
66
readme = "README.md"

subscriber/podaac_access.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import tenacity
3131
from datetime import datetime
3232

33-
__version__ = "1.13.1"
33+
__version__ = "1.14.0"
3434
extensions = ["\\.nc", "\\.h5", "\\.zip", "\\.tar.gz", "\\.tiff"]
3535
edl = "urs.earthdata.nasa.gov"
3636
cmr = "cmr.earthdata.nasa.gov"

subscriber/podaac_data_downloader.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_parser():
9393
# Get specific granule from the search
9494
# https://github.com/podaac/data-subscriber/issues/109
9595
parser.add_argument("-gr", "--granule-name", dest="granulename",
96-
help="Flag to download specific granule from a collection. This parameter can only be used if you know the granule name. Only one granule name can be supplied",
96+
help="Flag to download specific granule from a collection. This parameter can only be used if you know the granule name. Only one granule name can be supplied. Supports wildcard search patterns allowing the user to identify multiple granules for download by using `?` for single- and `*` for multi-character expansion.",
9797
default=None)
9898

9999
parser.add_argument("--process", dest="process_cmd",
@@ -190,6 +190,9 @@ def run(args=None):
190190
('GranuleUR[]', cmr_granule),
191191
('token', token),
192192
]
193+
#jmcnelis, 2023/06/14 - provide for wildcards in granuleur-based search
194+
if '*' in cmr_granule or '?' in cmr_granule:
195+
params.append(('options[GranuleUR][pattern]', 'true'))
193196
if args.verbose:
194197
logging.info("Granule: " + str(cmr_granule))
195198

0 commit comments

Comments
 (0)