Skip to content
Snippets Groups Projects
Commit 10703ed6 authored by HenryTux's avatar HenryTux
Browse files

calc_E changes

parent 825306be
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ z_coord_type = "p" ...@@ -43,7 +43,7 @@ z_coord_type = "p"
n = 1 n = 1
path = "./" + date_0.strftime("dat_%Y%m%d_%H") + "/" + str(n) + "/" path = "./dat_variablekp/" + date_0.strftime("dat_%Y%m%d_%H") + "/" + str(n) + "/"
if not exists(path): if not exists(path):
makedirs(path) makedirs(path)
...@@ -61,8 +61,8 @@ T = trajs['T'][::n] ...@@ -61,8 +61,8 @@ T = trajs['T'][::n]
H = cc.ptoh(P, 1013.25, 8.435) # standard atmosphere H = cc.ptoh(P, 1013.25, 8.435) # standard atmosphere
# k_p = cc.calc_k(U/1000, V/1000, Omg/100) k_p = cc.calc_k(U/1000, V/1000, Omg/100)
k_p=15 # k_p=15
k_h = cc.calc_k(U, V, cc.omg2w(Omg/100, T, P)) k_h = cc.calc_k(U, V, cc.omg2w(Omg/100, T, P))
D = list((list(), list(), list())) D = list((list(), list(), list()))
...@@ -102,7 +102,8 @@ for epsilon in epsilon_opt: ...@@ -102,7 +102,8 @@ for epsilon in epsilon_opt:
E = dd.io_eigen((path + "spnalp" + str(alpha) + str(t_sel[0]) + E = dd.io_eigen((path + "spnalp" + str(alpha) + str(t_sel[0]) +
str(t_sel[-1])), str(t_sel[-1])),
Lon.shape[0], t_sel[0], t_sel[-1], D[0], D[1], D[2], Lon.shape[0], t_sel[0], t_sel[-1], D[0], D[1], D[2],
epsilon, boundscs, 20, Lon, Lat, P, True, k_p, "p") epsilon, boundscs, 20, Lon, Lat, P, True, k_p, "p",
force_calc=True)
else: else:
x, y, z = cc.coord_trans(Lon, Lat, H, "None", 1, x, y, z = cc.coord_trans(Lon, Lat, H, "None", 1,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#SBATCH --array=1-24 #SBATCH --array=1-24
year=2016 year=2016
TRAPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/wp21/era5/traj/ TRAPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/wp21/era5/traj
CSPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/csstandalone CSPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/csstandalone
cd ${TRAPATH}/${year}/ cd ${TRAPATH}/${year}/
......
...@@ -47,7 +47,7 @@ for n in [1]: ...@@ -47,7 +47,7 @@ for n in [1]:
# only every nth trajectory # only every nth trajectory
print(n) print(n)
path = "./" + date_0.strftime("dat_%Y%m%d_%H") + "/" + str(n) + "/" path = "./dat_variablekp/" + date_0.strftime("dat_%Y%m%d_%H") + "/" + str(n) + "/"
if not exists(path): if not exists(path):
makedirs(path) makedirs(path)
......
#!/bin/bash #!/bin/bash
#SBATCH --array=0-7 #SBATCH --array=1-24
python calc_dist.py ${SLURM_ARRAY_TASK_ID} year=2016
TRAPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/wp21/era5/traj
CSPATH=/net/scratch/schoelleh96/WP2/WP2.1/LAGRANTO/csstandalone
cd ${TRAPATH}/${year}/
trafiles=`ls -v traj*`
CurrTrajF=`echo $trafiles | cut --delimiter " " --fields $SLURM_ARRAY_TASK_ID`
filename=${CurrTrajF##*/}
Y1=${filename:5:4}
M1=${filename:9:2}
D1=${filename:11:2}
H1=${filename:14:2}
python ${CSPATH}/calc_dist.py ${TRAPATH}/${year}/ ${Y1} ${M1} ${D1} ${H1}
...@@ -30,9 +30,9 @@ from warnings import catch_warnings, simplefilter ...@@ -30,9 +30,9 @@ from warnings import catch_warnings, simplefilter
# only every nth trajectory # only every nth trajectory
n = 1 n = 1
force_calc = False force_calc = True
date_0 = datetime(2016,5,4,18) date_0 = datetime(2016,5,4,12)
fname = "../wp21/era5/traj/" + date_0.strftime('%Y/traj_%Y%m%d_%H') + ".npy" fname = "../wp21/era5/traj/" + date_0.strftime('%Y/traj_%Y%m%d_%H') + ".npy"
B = dd.get_block_dat(date_0) B = dd.get_block_dat(date_0)
...@@ -86,7 +86,7 @@ elev = 45 ...@@ -86,7 +86,7 @@ elev = 45
dist = 7 dist = 7
t_i = 0 t_i = 0
alpha = 1e-3 alpha = 1e-3
e = 1e5 e = 100000
epsilon_opt = np.array([25000, 50000, 100000, 250000, 500000]) epsilon_opt = np.array([25000, 50000, 100000, 250000, 500000])
alph_opt = np.array([1e-4, 2e-4, 5e-4, 0.001, 0.002, 0.005, 0.01, 0.05, alph_opt = np.array([1e-4, 2e-4, 5e-4, 0.001, 0.002, 0.005, 0.01, 0.05,
0.1, 0.5, 1, 5, 10]) 0.1, 0.5, 1, 5, 10])
...@@ -103,8 +103,8 @@ k_h = cc.calc_k(trajs['U'], trajs['V'], cc.omg2w(trajs['OMEGA']/100, ...@@ -103,8 +103,8 @@ k_h = cc.calc_k(trajs['U'], trajs['V'], cc.omg2w(trajs['OMEGA']/100,
trajs['T'], trajs['p'])) trajs['T'], trajs['p']))
# %% Boundary # %% Boundary
if False: # if False:
# if argv[0] == '' or argv[1] == "Boundary": if argv[0] == '' or argv[1] == "Boundary":
# Initialize # Initialize
...@@ -286,7 +286,7 @@ if True: ...@@ -286,7 +286,7 @@ if True:
boundscs, hullscs = dd.io_bounds( boundscs, hullscs = dd.io_bounds(
path + "stereop", "$\\alpha$", xcs, ycs, zcs, path + "stereop", "$\\alpha$", xcs, ycs, zcs,
alpha) alpha, force_calc)
bound_meth = "$\\alpha$" bound_meth = "$\\alpha$"
...@@ -300,15 +300,16 @@ if True: ...@@ -300,15 +300,16 @@ if True:
E = dd.io_eigen((path + "spnalp" + str(alpha) + str(t_sel[0]) + E = dd.io_eigen((path + "spnalp" + str(alpha) + str(t_sel[0]) +
str(t_sel[-1])), str(t_sel[-1])),
lon.shape[0], t_sel[0], t_sel[1], D[0], D[1], D[2], e, lon.shape[0], t_sel[0], t_sel[-1], D[0], D[1], D[2], e,
boundscs, 20, lon, lat, p, True, k_p, "p") boundscs, 20, lon, lat, p, True, k_p, "p",
force_calc=force_calc)
kclust = cc.kcluster_idx(E, N_k) kclust = cc.kcluster_idx(E, N_k)
# upper case letters for visualization # upper case letters for visualization
Xcs, Ycs, Zcs = cc.coord_trans(lon, lat, p, "None", k_p, proj="stereo") Xcs, Ycs, Zcs = cc.coord_trans(lon, lat, p, "None", k_p, proj="stereo")
points = pp.plot_clustering(ax3dcs, Xcs, Ycs, Zcs, azim, elev, dist, t_i, points = pp.plot_clustering(ax3dcs, Xcs, Ycs, Zcs, azim, elev, dist, t_i,
c=kclust.labels_, plot_0=plot_0, c=kclust.labels_, plot_0=False,
coord="stereo", mean_traj=True, block=B, coord="stereo", mean_traj=True, block=B,
coast=coasts) coast=coasts)
ax3dcs.invert_zaxis() ax3dcs.invert_zaxis()
...@@ -335,7 +336,7 @@ if True: ...@@ -335,7 +336,7 @@ if True:
N_v_box = TextBox(N_v_ax, "$N_v$") N_v_box = TextBox(N_v_ax, "$N_v$")
N_v_box.set_val("2") N_v_box.set_val("2")
null_ax = fig_cs.add_axes([0.02, 0.43, 0.1, 0.05]) null_ax = fig_cs.add_axes([0.02, 0.43, 0.1, 0.05])
null_check = CheckButtons(null_ax, ["Plot start?"], [True]) null_check = CheckButtons(null_ax, ["Plot start?"], [False])
geo_ax = fig_cs.add_axes([0.1, 0.43, 0.1, 0.05]) geo_ax = fig_cs.add_axes([0.1, 0.43, 0.1, 0.05])
geo_check = CheckButtons(geo_ax, ["Plot features?"], [True]) geo_check = CheckButtons(geo_ax, ["Plot features?"], [True])
run_ax = fig_cs.add_axes([0.02, 0.35, 0.1, 0.05]) run_ax = fig_cs.add_axes([0.02, 0.35, 0.1, 0.05])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment