Skip to content
Snippets Groups Projects
configuration.py 2.75 KiB
Newer Older
from os.path import expanduser, join
from datetime import timedelta
# latN = 35
# latS = -35
# lonW = -100
# lonE = 45
Christoph.Fischer's avatar
Christoph.Fischer committed
data_lat = (-35, 35)
aew_clim_dir = '/home/christoph/phd/data/aew/clim/cv_clim_era5.nc' # '/home/christoph/phd/data/framework_example_ds/aew/' # '/project/meteo/w2w/C3/fischer/belanger/aew_clim/' #
in_files = '/home/christoph/phd/data/aew/cv/2008cv.nc' # '/home/christoph/phd/data/framework_example_ds/aew/cv_aug_08.nc'

out_dir = join(expanduser("~") + '/phd/data/aew/out/') # '/project/meteo/w2w/C3/fischer/belanger/out/'
plot_dir = join(expanduser("~") + '/phd/data/aew/plots/') # '/project/meteo/w2w/C3/fischer/belanger/plots/'

cv_data_dir = '/project/meteo/w2w/C2/athul/data_athul/AEW_cv_data/' # reference where ALL cv data is (for clim calc.)
cv_data_ex = join(cv_data_dir, '*.nc')
Christoph.Fischer's avatar
Christoph.Fischer committed
    #fn = (aew_clim_dir + "cv_clim_" + str(abs(data_lat[1])) + ('N' if data_lat[1] > 0 else 'S') + "_"
    #      + str(abs(data_lat[0])) + ('N' if data_lat[0] > 0 else 'S') + "_"
    #      + str(abs(data_lon[0])) + ('E' if data_lon[0] > 0 else 'W') + "_"
    #      + str(abs(data_lon[1])) + ('E' if data_lon[1] > 0 else 'W')) + ".nc"
# wave area to be extracted: at least one point of trough needs to be in this range
wave_filter_lat = (0, 30)
levels = [70000]  # 700 hPa
# time of interest, if None all
Christoph.Fischer's avatar
Christoph.Fischer committed
# june-oct is AEW season
Christoph.Fischer's avatar
Christoph.Fischer committed
start_date = None # '2008-09-01T00:00' #  # '2008-08-01T00:00'
end_date = None # '2008-09-30T00:00' # None # '2008-08-03T00:00'


# Algorithm parameters
# max u wind (m/s) (0 = only keep west-propagating). Belanger: 2.5; Berry: 0.0
max_u_thresh = 0.0  # m/s

# CV anomaly percentile
# NOTE: this is precomputed from the climatology, so delete climatology file and change this after to be re-executed.
cv_percentile = 66  # 66% percentile of PV anomalies as reference on what areas to consider

# need positive 2nd time derivative
second_advection_min_thr = 0.0

### FILTERING

# spatial filtering: if wave to small, discard
# threshold in degrees of wave length (sum of wave segments)
duration_threshold = timedelta(days=2)
# max time allowed between detected waves
max_cmp_delta = timedelta(hours=12)
avg_speed_t = timedelta(hours=36)
avg_speed_min_m_per_s = -3 # min abs, so faster than 3 to west
avg_speed_min_deg_per_h = avg_speed_min_m_per_s * 3.6 * 0.00914

# speed range of AEWs
# at 10°N we have in longitude direction 0.00914 degrees/km (360/(40,000*cos(10deg)))
speed_range_m_per_s = [3.0, 12.0] # [5,10], but be more gentle with polygons.
speed_deg_per_h = [-m_per_s * 3.6 * 0.00914 for m_per_s in speed_range_m_per_s]  # negative -> westward [-5, -10]