Skip to content
Snippets Groups Projects
configuration.py 1.92 KiB
Newer Older
from os.path import expanduser, join
from datetime import timedelta
# latN = 35
# latS = -35
# lonW = -100
# lonE = 45
aew_clim_dir = join(expanduser("~") + '/phd/data/aew/clim/')
cv_data_dir = join(expanduser("~") + '/phd/data/aew/cv/') # reference where ALL cv data is (for clim calc.)

# construct clim file, regenerate for each window?
def get_clim_file():
    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"
    return fn

# 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
start_date = '2008-08-01T00:00'
Christoph.Fischer's avatar
Christoph.Fischer committed
end_date = '2008-08-08T00: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)

# 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 = [0.0, 15.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]