Skip to content

Commit

Permalink
heart.init_geodetic_targets: use only local coordinates in targets wi…
Browse files Browse the repository at this point in the history
…th single reference latlon
  • Loading branch information
hvasbath committed Jan 25, 2024
1 parent 94ab075 commit d109ec4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions beat/heart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,7 @@ def get_store_id(prefix, earth_model_name, sample_rate, crust_ind=0):

def init_geodetic_targets(
datasets,
event,
earth_model_name="ak135-f-average.m",
interpolation="nearest_neighbor",
crust_inds=[0],
Expand All @@ -1622,6 +1623,8 @@ def init_geodetic_targets(
datasets : list
of :class:`heart.GeodeticDataset` for which the targets are being
initialised
event : :class:`pyrocko.model.Event`
for geographic referencing of the targets
earth_model_name = str
Name of the earth model that has been used for GF calculation.
sample_rate : scalar, float
Expand All @@ -1641,8 +1644,8 @@ def init_geodetic_targets(

targets = [
gf.StaticTarget(
lons=d.lons,
lats=d.lats,
lons=num.full_like(d.lons, event.lon),
lats=num.full_like(d.lons, event.lat),
east_shifts=d.east_shifts,
north_shifts=d.north_shifts,
interpolation=interpolation,
Expand Down
3 changes: 3 additions & 0 deletions beat/models/geodetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self, gc, project_dir, events, hypers=False):
# init geodetic targets
self.targets = heart.init_geodetic_targets(
datasets=self.datasets,
event=self.event,
earth_model_name=gc.gf_config.earth_model_name,
interpolation=gc.interpolation,
crust_inds=[gc.gf_config.reference_model_idx],
Expand Down Expand Up @@ -778,6 +779,7 @@ def update_weights(self, point, n_jobs=1, plot=False):
for i, data in enumerate(self.datasets):
crust_targets = heart.init_geodetic_targets(
datasets=[data],
event=self.event,
earth_model_name=gc.gf_config.earth_model_name,
interpolation=gc.interpolation,
crust_inds=crust_inds,
Expand Down Expand Up @@ -901,6 +903,7 @@ def update_weights(self, point, n_jobs=1, plot=False):
for i, data in enumerate(self.datasets):
crust_targets = heart.init_geodetic_targets(
datasets=[data],
event=self.event,
earth_model_name=gc.gf_config.earth_model_name,
interpolation=gc.interpolation,
crust_inds=crust_inds,
Expand Down
1 change: 1 addition & 0 deletions beat/plotting/seismic.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def draw_earthmodels(problem, plot_options):
if not os.path.exists(outpath) or po.force:
targets = init_geodetic_targets(
datasets=composite.datasets,
event=problem.config.event,
earth_model_name=gc.gf_config.earth_model_name,
interpolation="multilinear",
crust_inds=list(range(*gc.gf_config.n_variations)),
Expand Down

0 comments on commit d109ec4

Please sign in to comment.