Skip to content

Commit

Permalink
remove old, hacky ways to extact RR info from TFs
Browse files Browse the repository at this point in the history
  • Loading branch information
kkappler committed Sep 8, 2023
1 parent b6d2a21 commit bfcf3b4
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions aurora/test_utils/earthscope/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,73 +121,6 @@ def load_xml_tf(file_path):
return spud_tf


def get_remotes_from_tf_not(tf_obj):
remote_references = tf_obj.station_metadata.get_attr_from_name('transfer_function.remote_references')
remotes = list()
for remote_station in remote_references:
if not len(remote_station.split('-')) > 1:
if remote_station != station:
remotes.append(remote_station)

return remotes

def get_rr_info(tf_obj):
rr_info_list = tf_obj.station_metadata.transfer_function.processing_parameters
# this may have more than one entry .. why?
assert len(rr_info_list) == 1
rr_info_instance = rr_info_list[0]
return rr_info_instance

def get_rr_type(tf_obj):
rr_info_instance = get_rr_info(tf_obj)
rr_type = rr_info_instance["remote_ref.type"]
return rr_type


def get_remotes_from_tf_2(tf_obj):
"""
A second way to get remotes
:param tf_obj:
:return:
"""
attr_name = "transfer_function.remote_references"
remote_references = tf_obj.station_metadata.get_attr_from_name(attr_name)
remotes = list()
for remote_station in remote_references:
if not len(remote_station.split('-')) > 1:
# if remote_station != station:
remotes.append(remote_station)
print(remote_references)
return remotes

def get_remotes_from_tf(tf_obj):
"""
There were 5 cases of RemoteRef type encountered when reviewing SPUD TFs
These were:
1. Robust Remote Reference 1452
2. Robust Multi-Station Reference 328
3. Robust Multi-station Reference 15
4. Multi-Station Reference 1
5. Merged Transfer Functions 52
where the number of instaces of each is listed on the right.
:param tf_obj:
:return:
"""
rr_info_instance = get_rr_info(tf_obj)
if rr_info_instance["remote_ref.type"] == "Robust Remote Reference":
# then there is only one
try:
remotes = [rr_info_instance["remote_info.site.id"], ]
except KeyError:
print(" No remote listed in xml at expected location")
# here an an example: https: // ds.iris.edu / spudservice / data / 14862696
return []
else:
remotes = get_remotes_from_tf_2(tf_obj)
return remotes


def get_summary_table_schema_v2(stage_number):
"""
Expand Down

0 comments on commit bfcf3b4

Please sign in to comment.