Skip to content

Commit

Permalink
Added --no-kernels flag to downoadIsisData (#5339)
Browse files Browse the repository at this point in the history
* Added --no-kernels flag

* Updated usage comment for kernel exclusion

* Resolved merge conflicts

* Updated changelog

* Added tspk, dsk to list of ignored kernels

* Added old, specialproducts, and orbnum to global excludes list
  • Loading branch information
AustinSanders authored Nov 20, 2023
1 parent edf2def commit 6c42917
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ release.
own name; if not specified retains existing behavior [#5125](https://github.com/USGS-Astrogeology/ISIS3/issues/5162)
- Added new parameters <b>ONERROR</b>, <b>ERRORLOG</b>, and <b>ERRORLIST</b> to <i>mosrange</i> to provide better control over error behavior and provide diagnostics when problems are encountered processing the input file list.[#3606](https://github.com/DOI-USGS/ISIS3/issues/3606)
- Added ability to delegate calculation of nadir pointing to ALE [#5117](https://github.com/USGS-Astrogeology/ISIS3/issues/5117)
- Added --no-kernels flag to downloadIsisData [#5264](https://github.com/DOI-USGS/ISIS3/issues/5264)

### Deprecated

Expand Down
13 changes: 11 additions & 2 deletions isis/scripts/downloadIsisData
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ filter_list = [
'- document/',
'- *.csv',
'- toolkit/',
'- kernels_ORG/'
'- kernels_ORG/',
'- orbnum/**',
'- old/**',
'- SpecialProducts/**'
]

def find_conf():
Expand Down Expand Up @@ -145,6 +148,11 @@ def create_rclone_arguments(destination, mission_name, parsedArgs, rclone_kwargs
excludes = [f"- {arg}" for arg in args.exclude]
filter_list.extend(excludes)

if args.no_kernels:
excludes = [f"- {arg}" for arg in ['ck/**','ek/**','fk/**','ik/**','iak/**','lsk/**','mk/**','pck/**','sclk/**','spk/**','tspk/**','dsk/**']]
filter_list.extend(excludes)


# we need to add this to the end
if args.include:
filter_list.append("- *")
Expand Down Expand Up @@ -224,7 +232,7 @@ if __name__ == '__main__':
$ downloadIsisData tgo $ISISDATA
# download everything except kernels with debug output
$ downloadIsisData all $ISISDATA --dry-run --exclude="kernels/**" -vv
$ downloadIsisData all $ISISDATA --dry-run --no-kernels -vv
# download only cks and fks
$ downloadIsisData all $ISISDATA --include="{ck/**,fk/**}"
Expand All @@ -238,6 +246,7 @@ if __name__ == '__main__':
parser.add_argument('--filter', help='Additional filters for files', nargs='*')
parser.add_argument('--include', help='files and patterns to include while downloading', nargs='*')
parser.add_argument('--exclude', help='files and patterns to ignore while downloading', nargs='*')
parser.add_argument('--no-kernels', help='Exclude all kernel files from download. Analogous to --exclude="{ck/**,ek/**,fk/**,ik/**,iak/**,lsk/**,mk/**,pck/**,sclk/**,spk/**,tspk/**,dsk/**}"', default=False, action='store_true')
parser.add_argument('-c', '--command', choices=["copy", "sync", "ls", "lsd", "size"], help='files and patterns to ignore while downloading', default="copy")

args, kwargs = parser.parse_known_args()
Expand Down

0 comments on commit 6c42917

Please sign in to comment.