Skip to content
Snippets Groups Projects
Commit 86d28421 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent f9c55f72
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import xarray as xr ...@@ -6,6 +6,7 @@ import xarray as xr
from netCDF4 import Dataset, Dimension, Variable from netCDF4 import Dataset, Dimension, Variable
from aeolus.geos_nav import GEOSNavigation from aeolus.geos_nav import GEOSNavigation
from util.util import haversine_np from util.util import haversine_np
from amv.intercompare import best_fit
import math import math
...@@ -158,7 +159,7 @@ class CarrStereo(AMVFiles): ...@@ -158,7 +159,7 @@ class CarrStereo(AMVFiles):
# raob_dict: time -> profiles # raob_dict: time -> profiles
# amv_files_path: directory containing AMVs, '/home/user/amvdir/' # amv_files_path: directory containing AMVs, '/home/user/amvdir/'
# return dict: aeolus time -> tuple (amv_lon, amv_lat, amv_pres, amv_spd, amv_dir) # return dict: raob -> tuple (amv_lon, amv_lat, amv_pres, amv_spd, amv_dir)
def match_amvs_to_raobs(raob_dict, raob_time, amv_files): def match_amvs_to_raobs(raob_dict, raob_time, amv_files):
nav = amv_files.get_navigation() nav = amv_files.get_navigation()
amv_params = amv_files.get_parameters() amv_params = amv_files.get_parameters()
...@@ -315,6 +316,33 @@ def create_file2(filename, raob_to_amv_dct, raob_dct, amv_files): ...@@ -315,6 +316,33 @@ def create_file2(filename, raob_to_amv_dct, raob_dct, amv_files):
rootgrp.close() rootgrp.close()
def analyze2(raob_to_amv_dct, raob_dct):
keys = list(raob_to_amv_dct.keys())
for key in keys:
rlat = key[0]
rlon = key[1]
raob = raob_dct.get(key)
nlevs = raob.shape[0]
raob_prs = raob[:, 0]
raob_spd = raob[:, 3]
raob_dir = raob[:, 2]
amvs = raob_to_amv_dct.get(key)
num_amvs = amvs.shape[1]
for i in range(num_amvs):
amv_lon = amvs[0, i]
amv_lat = amvs[1, i]
amv_prs = amvs[4, i]
amv_spd = amvs[5, i]
amv_dir = amvs[6, i]
bf = best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, raob_spd, raob_dir, raob_prs)
if bf[3] == 0:
print(nlevs, amv_prs, bf[2])
# imports the S4 NOAA output # imports the S4 NOAA output
# filename: full path as a string, '/home/user/filename' # filename: full path as a string, '/home/user/filename'
# returns a dict: time -> list of profiles (a profile is a list of levels) # returns a dict: time -> list of profiles (a profile is a list of levels)
......
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