Skip to content
Snippets Groups Projects
Commit 1ff93105 authored by tomrink's avatar tomrink
Browse files

minor...

parent 5573d988
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ import h5py
from util.util import get_grid_values, get_grid_values_all, is_night, compute_lwc_iwc
import glob
import os
from aeolus.datasource import CLAVRx_VIIRS
from icing.moon_phase import *
from pathlib import Path
emis_params = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13_3um_nom', 'temp_3_75um_nom',
......@@ -216,28 +218,23 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=64, border=
def scan(directory):
for p in os.scandir(directory):
if not p.is_dir():
continue
files = glob.glob(directory + p.name+'/'+'clavrx_snpp_viirs*.uwssec*.h5')
num_files = len(files)
num_keep = 0
for idx, file in enumerate(files):
h5f = h5py.File(file, 'r')
try:
solzen = get_grid_values_all(h5f, 'solar_zenith_angle')
except Exception as e:
# print(e)
h5f.close()
continue
if is_night(solzen):
num_keep += 1
print(file)
data_src = CLAVRx_VIIRS(directory)
files = data_src.flist
for idx, file in enumerate(files):
h5f = h5py.File(file, 'r')
ts = data_src.ftimes[0]
try:
solzen = get_grid_values_all(h5f, 'solar_zenith_angle')
except Exception as e:
# print(e)
h5f.close()
continue
print(num_files, num_keep)
if is_night(solzen) and moon_phase(ts):
print(file)
h5f.close()
def test_nlcomp(file):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment