Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all runs being assigned to mth5 when building from FDSN #153

Closed
kkappler opened this issue Jun 16, 2023 · 1 comment
Closed

Not all runs being assigned to mth5 when building from FDSN #153

kkappler opened this issue Jun 16, 2023 · 1 comment
Assignees

Comments

@kkappler
Copy link
Collaborator

There is some logic mth5/mth5/clients/fdsn.py concerned with parsing the streams objects returned by obspy that reconciles the number of runs in the mth5 with the number of data streams that were extracted from the fdsn data repository.

This logic needs to be updated to accommodate the FourierCoefficients and TransferFunctions containers.

In particular:
run_list = m.get_station(station_id, survey_id).groups_list
currently returns, for example:

['001', 'Fourier_Coefficients', 'Transfer_Functions']

But it should return

['001', ]

@kkappler kkappler self-assigned this Jun 16, 2023
kkappler added a commit that referenced this issue Jun 17, 2023
kkappler added a commit that referenced this issue Jun 17, 2023
Six instances of the same block of three lines replaced with one call.

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
Also, in loop where there is only 1 run in runlist, but
multiple streams from FDSN, cast start,end from times[0],[1]
so that the rest of the logic is same as other cases

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
Clean up logic for case n_runs==1
We were checking n_times > 1, with an elif n_times == 1
BUT
this logic lay within an elif following a check that n_runs==n_times

Since to be in this block at all, means that n_runs!=n_times,
then if n_runs==1 we know that n_times!=1, so we don't need to check/handle that

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
This method is key to merging wrangle_runs_into_containers_v1 and
wrangle_runs_into_containers_v2, because a v1 mth5 object can get
a survey group with the same method as can a v2 survey_group

Thus we can replace:
  run_group = m.stations_group.get_station(station_id).add_run(run_id)
  &
  run_group = survey_group.stations_group.get_station(station_id).add_run(run_id)

with:
  run_group = mth5_obj_or_survey.stations_group.get_station(station_id).add_run(run_id)

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
- cast start_times and end_times to UTCDateTime in stream_boundaries, as they are only accessed in that form later
- add run_timings_match_stream_timing method to greatly simplify len(run_list) != n_times case logic.

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
replaced with get_station_streams method

[Issue(s): #153
kkappler added a commit that referenced this issue Jun 17, 2023
also simplify interact logic at end of make

[Issue(s): #153]
kkappler added a commit that referenced this issue Jun 17, 2023
Remove cruft.

[Issue(s): #153]
@kujaku11
Copy link
Owner

Should be fixed with PR #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants