Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions EXAMPLES/applications/cmt_force_hybrid/get_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

np.random.seed(10)

nsta = 10
x = -1500 + np.random.rand(nsta) * 3000
y = -1500 + np.random.rand(nsta) * 3000
nsta = 10
x = -1500 + np.random.rand(nsta) * 3000
y = -1500 + np.random.rand(nsta) * 3000

fio = open("DATA/STATIONS","w")
for i in range(nsta):
Expand Down
8 changes: 4 additions & 4 deletions EXAMPLES/applications/cmt_force_hybrid/step1_get_stf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt

def ricker_wavelet(t, f_c):
"""
Expand All @@ -18,7 +18,7 @@ def ricker_wavelet(t, f_c):

nt = 3000
dt = 2.0e-3
t = np.arange(nt) * dt
t = np.arange(nt) * dt

NS_CMT = 10
NS_FORCE = 5
Expand All @@ -32,7 +32,7 @@ def ricker_wavelet(t, f_c):
fio.write("%f\n" %(stf[it]))

# cmt
stf1 = np.cumsum(stf) * dt
stf1 = np.cumsum(stf) * dt
for i in range(NS_CMT):
with open(f"DATA/stf.cmt.{i}.txt","w") as fio:
for it in range(nt):
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLES/applications/cmt_force_hybrid/step4_plot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt

# load data
stnm = 'XA.A2.CXZ.semd'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def get_waveforms_from_specfem(self, fn_list, fn_stations,
except Exception as e:
sys.exit(f"{e}\n")
self.coord_list = coord_list

waveforms = []
if t is not None:
if (verbose==1): print(f'use time t0={t[0]}, dt={t[1]-t[0]}, nt={nt}\n')
Expand Down Expand Up @@ -250,6 +250,6 @@ def get_waveforms_from_specfem(self, fn_list, fn_stations,
except Exception as e:
sys.exit(f"{e}\n")
self.waveforms = waveforms
self.t = t
self.t = t


Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def save_as_GeoCSV():
header = f"""
# dataset: GeoCSV2.0
# created: {str(datetime.datetime.now())}
# delimiter: |
# delimiter: |
# global_title: CentralAlp_VelocityModel_3D
# global_model: CentralAlp_VelocityModel_3D_Pg_Sg_v07
# global_id: CentralAlp_VelocityModel_3D_Pg_Sg_v07
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def amplitude_correction(st,catalog,inventory):

# original for vis
trace_org = tr.data.copy()

# correct waveform
tr.data = tr.data * correction_factor

Expand Down Expand Up @@ -1006,14 +1006,14 @@ def add_missing_zero_traces(st):
from obspy.core.trace import Stats

complete_stream = Stream()

# Get unique station names from the stream
stations = sorted(list(set(tr.stats.station for tr in st)))

for station_name in stations:
# Extract traces for the current station
station_traces = st.select(station=station_name)

# Check for existing channels
channels = sorted(list(set(tr.stats.channel for tr in station_traces)))

Expand All @@ -1037,7 +1037,7 @@ def add_missing_zero_traces(st):
print(f" station {station_name}: adding zero trace for {channel}")
zero_data = np.zeros(num_samples, dtype=stored_trace.data.dtype)
zero_trace = Trace(data=zero_data)

# Copy relevant stats and update channel
zero_trace.stats = stored_trace.stats.copy()
#zero_trace.stats.network = stored_trace.stats.network
Expand All @@ -1059,7 +1059,7 @@ def add_missing_zero_traces(st):

# Sort the stream to ensure consistent ordering (optional but good practice)
complete_stream.sort(['station', 'channel'])

return complete_stream

#----------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLES/real_world/Moon_Apollo_impact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The setup is done by the following steps:
The script also modified the entries in the `interfaces.dat` to read the correct number of entries and increments.
It also modifies `Mesh_Par_file` to set the correct mesh lat/lon-dimensions and lunar projection zone number (as the `UTM_PROJECTION_ZONE`).

> [!NOTE]
> [!NOTE]
> For Moon simulations, instead of the Universal Transverse Mercator (UTM) projection valid for Earth, the mesher will use a Lunar Transverse Mercator (LTM) projection (for latitudes between [-82,82] degrees) or a Lunar Polar Stereographic (LPS) at North/South pole regions. To enable these lunar projections, use a model name starting with `moon_***` (see `moon_default` in `Par_file`; or use `moon_tomo` for combining it with a tomography model).
>
> The zone numbers are positive for the Northern hemisphere and negative for Southern hemisphere. LTM uses zone numbers in the range +/- [1,45], LPS uses 46 for North pole and -46 for South pole regions. The script `run_get_simulation_topography.py` will output the corresponding zone number for the specified area (using its midpoint to determine the zone).
Expand Down
Loading
Loading