-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (37 loc) · 1.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/env python
from NOMADSExplorer import nomad
from NOMADSExplorer.explore import discovery
from argparse import ArgumentParser
def create_commandline_parser():
parser = ArgumentParser("Add Description Here")
parser.add_argument(
"address",
type=str,
default="https://nomads.ncep.noaa.gov/pub/data/nccf/com/nwm/prod/",
help="Where to find the National Water Model data"
)
parser.add_argument(
"-o",
metavar="path",
default="nwm.gpkg",
type=str,
help="Where to save the output"
)
parser.add_argument(
"-e",
metavar="explorer_type",
dest="explorer_type",
choices=discovery.EXPLORERS.keys(),
default="remote",
type=str,
help="The type of Netcdf explorer that will look for the data"
)
return parser
def main():
parser = create_commandline_parser()
parameters = parser.parse_args()
searcher = nomad.Nomad(parameters.address, parameters.explorer_type)
searcher.explore()
print(searcher.catalog)
if __name__ == "__main__":
main()