-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0acf4b5
commit 884386e
Showing
8 changed files
with
80 additions
and
10 deletions.
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 |
---|---|---|
|
@@ -3,4 +3,7 @@ | |
*.h5* | ||
*.json | ||
*GranuleList* | ||
*.Rhistory* | ||
*.Rhistory* | ||
*.gpkg* | ||
*.shp* | ||
*__pycache__* |
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,2 +1,59 @@ | ||
import GEDIPipeline | ||
from pipeline.pipeline import GEDIPipeline | ||
|
||
import argparse | ||
|
||
# --------------------------COMMAND LINE ARGUMENTS AND ERROR HANDLING---------------------------- # | ||
# Set up argument and error handling | ||
parser = argparse.ArgumentParser(description='This pipeline performs all of the tasks (Finding, Downloading, Subsetting) to get GEDI Data.') | ||
|
||
parser.add_argument('--dir', required=True, help='Local directory to save GEDI files to be processed / Save the subsetted granules.') | ||
|
||
parser.add_argument('--product', required=True, help='GEDI Product to specify for the search query and subsetting module \ | ||
Select from "GEDI01_B"; "GEDI02_A"; "GEDI02_B"; "GEDI04_A"') | ||
|
||
parser.add_argument('--version', required=True, help='GEDI Product version to specify for the search query and subsetting module \ | ||
Select from "001"; "002"') | ||
|
||
parser.add_argument('--start', required=True, help='Start date for time period of interest: valid format is yyyy.mm.dd (e.g. 2020.11.12).') | ||
|
||
parser.add_argument('--end', required=True, help='Start date for time period of interest: valid format is yyyy.mm.dd (e.g. 2021.07.01).') | ||
|
||
parser.add_argument('--roi', required=True, help='Region of interest (ROI) to subset the GEDI orbit to in the output file. \ | ||
Valid inputs are a geojson or .shp file or bounding box coordinates: ul_lat,ul_lon,lr_lat,lr_lon') | ||
|
||
parser.add_argument('--beams', required=False, help='Specific beams to be included in the output file (default is all beams) \ | ||
BEAM0000,BEAM0001,BEAM0010,BEAM0011 are Coverage Beams. BEAM0101,BEAM0110,BEAM1000,BEAM1011 are Full Power Beams.', default=None) | ||
|
||
parser.add_argument('--sds', required=False, help='Specific science datasets (SDS) to include in the output subsetted file. \ | ||
(see README for a list of available SDS and a list of default SDS returned for each product).', default=None) | ||
|
||
parser.add_argument('--login_keep', required=False, help='Include this option to keep EarthData login saved to this machine. It defaults saving to \ | ||
the .netrc file', action='store_true') | ||
|
||
args = parser.parse_args() | ||
|
||
# ------------------------------------------------------------------------------------# | ||
|
||
pipeline = GEDIPipeline( | ||
out_directory = args.dir, | ||
product = args.product, | ||
version = args.version, | ||
date_start = args.start, | ||
date_end = args.end, | ||
roi = args.roi, | ||
beams = args.beams, | ||
sds = args.sds, | ||
persist_login = args.login_keep | ||
) | ||
|
||
print("[Pipeline] Pipeline set, starting ...") | ||
|
||
try: | ||
granules = pipeline.run_pipeline() | ||
except Exception as e: | ||
print("[Pipeline] Failed to complete running the Pipeline. See the error below for more information.") | ||
print(e) | ||
exit(0) | ||
|
||
print(f"[Pipeline] Pipeline Run Complete! Subsetted {len(granules)} files saved to: {args.dir}") | ||
|
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 +0,0 @@ | ||
from .gedi_pipeline import GEDIPipeline | ||
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
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from gedi_downloader import GEDIDownloader | ||
|
||
downloader = GEDIDownloader() | ||
|
||
downloader.download_granule(url="https://data.ornldaac.earthdata.nasa.gov/protected/gedi/GEDI_L4A_AGB_Density_V2_1/data/GEDI04_A_2019222172335_O03740_03_T02786_02_002_02_V002.h5") |