-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from andypbarrett/add-download-onprem-howto
add download from onprem how-to to documentation
- Loading branch information
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
# Download data for on-prem datasets | ||
|
||
Coming soon | ||
Import the `earthaccess` library, search for granules in an on-prem dataset and download to a local computer. | ||
The Sea Ice Concentrations from Nimbus-7 SMMR and DMSP SSM/I-SSMIS Passive Microwave Data, Version 2, dataset is used. | ||
This has the shortname NSIDC-0051. We search for and download data granules for the northern hemisphere for November 2023. | ||
In this example, granules are downloaded to the current working directory using the `local_path` keyword. This can be changed to your preferred download location. | ||
|
||
```py | ||
import earthaccess | ||
|
||
auth = earthaccess.login() | ||
|
||
results = earthaccess.search_data( | ||
short_name='NSIDC-0051', | ||
temporal=('2022-11-01', '2022-11-30'), | ||
bounding_box=(-180, 0, 180, 90) | ||
) | ||
|
||
downloaded_files = earthaccess.download( | ||
results, | ||
local_path='.', | ||
) | ||
``` |