Skip to content

Commit

Permalink
change vp/vs and eps
Browse files Browse the repository at this point in the history
  • Loading branch information
borong committed Oct 27, 2024
1 parent 8de306f commit da0705a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
9 changes: 7 additions & 2 deletions examples/california/run_adloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run_adloc(

# %%
config["mindepth"] = 0.0
config["maxdepth"] = 30.0
config["maxdepth"] = 60.0
config["use_amplitude"] = True

# %%
Expand Down Expand Up @@ -151,8 +151,11 @@ def run_adloc(
# Northern California (Gil7)
zz = [0.0, 1.0, 3.0, 4.0, 5.0, 17.0, 25.0, 62.0]
vp = [3.2, 3.2, 4.5, 4.8, 5.51, 6.21, 6.89, 7.83]
vs = [1.5, 1.5, 2.4, 2.78, 3.18, 3.40, 3.98, 4.52]
# vs = [1.5, 1.5, 2.4, 2.78, 3.18, 3.40, 3.98, 4.52]
vp_vs_ratio = 1.73
vs = [v / vp_vs_ratio for v in vp]
h = 0.3
# h = 0.1

vel = {"Z": zz, "P": vp, "S": vs}
config["eikonal"] = {
Expand Down Expand Up @@ -384,6 +387,8 @@ def parse_args():
calc_jdays = lambda year: 366 if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) else 365
jdays = [f"{year}.{i:03d}" for i in range(1, calc_jdays(year) + 1)]
jdays = [jdays[i::num_nodes] for i in range(num_nodes)]
# jdays = [[f'2023.{i:03d}' for i in range(41, 51)]]
jdays = [[f"{year}.366"]] # for leap year

# %%
with fs.open(f"{bucket}/{region}/config.json", "r") as fp:
Expand Down
25 changes: 24 additions & 1 deletion examples/california/run_gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_gamma(
jday = int(jday.split(".")[1])

# %%
result_path = f"{region}/gamma_bo/{year:04d}"
result_path = f"{region}/gamma_bo3/{year:04d}"
if not os.path.exists(f"{root_path}/{result_path}"):
os.makedirs(f"{root_path}/{result_path}")

Expand Down Expand Up @@ -144,6 +144,25 @@ def run_gamma(
2021: 10.5,
2020: 10.5,
2019: 10.5,
2018: 10.5,
2017: 10.5,
2016: 11.0,
2015: 12.5,
2014: 12.5,
2013: 13.0,
2012: 13.0,
2011: 13.0,
2010: 14.0,
2009: 15.5,
2008: 16.0,
2007: 14.0,
2006: 14.0,
2005: 14.0,
2004: 14.0,
2003: 14.0,
2002: 14.0,
2001: 14.0,
2000: 15.0,
}
config["dbscan_eps"] = eps_year[year]
config["dbscan_min_samples"] = 6
Expand All @@ -158,6 +177,8 @@ def run_gamma(
zz = [0.0, 1.0, 3.0, 4.0, 5.0, 17.0, 25.0, 62.0]
vp = [3.2, 3.2, 4.5, 4.8, 5.51, 6.21, 6.89, 7.83]
vs = [1.5, 1.5, 2.4, 2.78, 3.18, 3.40, 3.98, 4.52]
vp_vs_ratio = 1.73
vs = [v / vp_vs_ratio for v in vp]
h = 0.3
vel = {"z": zz, "p": vp, "s": vs}
config["eikonal"] = {
Expand Down Expand Up @@ -310,6 +331,8 @@ def parse_args():
calc_jdays = lambda year: 366 if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) else 365
jdays = [f"{year}.{i:03d}" for i in range(1, calc_jdays(year) + 1)]
jdays = [jdays[i::num_nodes] for i in range(num_nodes)]
# jdays = [['2018.032', '2018.064', '2018.096', '2018.128', '2018.160', '2018.192', '2018.224', '2018.256', '2018.288', '2018.320', '2018.352']]
jdays = [[f'{year}.366']] # for leap year

# %%
with fs.open(f"{bucket}/{region}/config.json", "r") as fp:
Expand Down

0 comments on commit da0705a

Please sign in to comment.