-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patho.py
39 lines (33 loc) · 1.01 KB
/
o.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (C) 2022 The HDF Group
#
# Author: Hyo-Kyung Lee ([email protected])
#
# Last Update: 2022/12/16
###########################################################################
"""
Read all datasets from all files using DMR++.
"""
import os
import glob
from pydap.client import open_url
# These large datasets will make program hang.
skip = ["analysed_sst", "analysis_error", "mask", "sea_ice_fraction"]
# Docker mounts /tmp/dmrpp and generates DMR++ there.
for f in sorted(glob.glob("/tmp/dmrpp/*.dmrpp")):
## DAP2
# url = 'http://localhost:8080/opendap/' + os.path.basename(f)
## DAP4
url = "dap4://localhost:8080/opendap/" + os.path.basename(f)
print(url)
dataset = open_url(url)
print(dataset)
for i in dataset.keys():
print(i)
if i not in skip:
d = dataset[i][:]
print(d)
else:
print("Skipping " + i)