Skip to content

Commit

Permalink
Merge pull request #140 from podaac/release/1.14.0
Browse files Browse the repository at this point in the history
Release/1.14.0
  • Loading branch information
skorper committed Jul 18, 2023
2 parents f4e9f51 + 5daf6e7 commit aebd818
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

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

## [1.14.0]
### Added
- 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).

## 1.13.1
### Fixed
- Fixed an issue where a required library wasn't being included in the installation.
Expand Down
3 changes: 2 additions & 1 deletion Downloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ optional arguments:
-e EXTENSIONS, --extensions EXTENSIONS
Regexps of extensions of products to download. Default is [.nc, .h5, .zip, .tar.gz, .tiff]
-gr GRANULENAME, --granule-name GRANULENAME
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
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.
--process PROCESS_CMD
Processing command to run on each downloaded file (e.g., compression). Can be specified multiple times.
--version Display script version information and exit.
Expand Down Expand Up @@ -131,6 +131,7 @@ The `-gr` option works by taking the file name, removing the suffix and searchin

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.

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).

### Download data by cycle

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "podaac-data-subscriber"
version = "1.13.1"
version = "1.14.0"
description = "PO.DAAC Data Subscriber Command Line Tool"
authors = ["PO.DAAC <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion subscriber/podaac_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import tenacity
from datetime import datetime

__version__ = "1.13.1"
__version__ = "1.14.0"
extensions = ["\\.nc", "\\.h5", "\\.zip", "\\.tar.gz", "\\.tiff"]
edl = "urs.earthdata.nasa.gov"
cmr = "cmr.earthdata.nasa.gov"
Expand Down
5 changes: 4 additions & 1 deletion subscriber/podaac_data_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def create_parser():
# Get specific granule from the search
# https://github.com/podaac/data-subscriber/issues/109
parser.add_argument("-gr", "--granule-name", dest="granulename",
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",
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.",
default=None)

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

Expand Down

0 comments on commit aebd818

Please sign in to comment.