Skip to content
Snippets Groups Projects
Commit 7d2f324d authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 97ba1e3f
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,7 @@ def get_search_box(cc, ll):
return c_rng, l_rng
def match_calipso_clavrx_to_amvs(calipso_clavrx_path, calipso_clavrx_file, amv_files_path, amv_source='OPS', band='14', amv_files=None):
if amv_files is None:
amv_files = get_datasource(amv_files_path, amv_source, band=band)
def match_calipso_clavrx_to_amvs(calipso_clavrx_ds, calipso_clavrx_file, amv_files, amv_source='OPS', band='14'):
nav = amv_files.get_navigation()
amv_params = amv_files.get_parameters()
all_params = [amv_files.lon_name, amv_files.lat_name, amv_files.elem_name, amv_files.line_name] + amv_params
......@@ -39,18 +37,18 @@ def match_calipso_clavrx_to_amvs(calipso_clavrx_path, calipso_clavrx_file, amv_f
coords = {'num_params': all_params}
dims = ['num_params', 'num_amvs']
calipso_clavrx_ds = CLAVRx_CALIPSO(calipso_clavrx_path)
#calipso_clavrx_ds = CLAVRx_CALIPSO(calipso_clavrx_path)
nom_time = calipso_clavrx_ds.get_datetime(calipso_clavrx_file).timestamp()
calipso_clavrx_nc4 = Dataset(calipso_clavrx_file)
fname, ftime, f_idx = amv_files.get_file_containing_time(nom_time)
amv_fname, ftime, f_idx = amv_files.get_file_containing_time(nom_time)
if f_idx is None:
return
match_dict[nom_time] = []
amv_ds = Dataset(fname)
amv_ds = Dataset(amv_fname)
amv_lons = amv_ds[amv_files.lon_name][:]
amv_lats = amv_ds[amv_files.lat_name][:]
if amv_files.elem_name is not None:
......@@ -261,6 +259,20 @@ def create_file(match_dct, filename, caliop_clavrx_params, amv_params):
rootgrp.close()
def run_caliop_clavrx_amv_match(output_file, path_to_caliop_clavrx, path_to_amvs, amv_source='OPS', band='14'):
caliop_clavrx_ds = CLAVRx_CALIPSO(path_to_caliop_clavrx)
amv_files = get_datasource(path_to_amvs, amv_source, band=band)
amv_params = amv_files.get_parameters()
match_dict = match_calipso_clavrx_to_amvs(caliop_clavrx_ds, None, amv_files, amv_source=amv_source, band=band)
caliop_clavrx_params = get_parameters_caliop_clavrx()
create_file(match_dict, output_file, caliop_clavrx_params, amv_params)
# def run_clavrx_to_aeolus_match(aeolus_files_dir, clvrx_files_dir, outfile, chan='mie'):
# if os.path.isdir(aeolus_files_dir):
# a_dct = get_aeolus_time_dict_s(aeolus_files_dir, chan=chan)
......
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