Skip to content
Snippets Groups Projects
Commit c00cea3f authored by Lloyd Carothers's avatar Lloyd Carothers
Browse files

Refactor function determining if chan is geophysical by name to hardware.py.

parent 5813af47
No related branches found
No related tags found
1 merge request!4Adjust what channel names are considered geophysical channels, and responses fetched from NRL.
......@@ -22,6 +22,12 @@ resp_dir = os.path.join(etc_dir, 'SOH_RESP')
defaultsfile = os.path.join(etc_dir,'nexus.hardware')
def chan_name_is_geophysical(channel_code):
if channel_code[1] in ('H', 'L', 'G','N'):
return True
else:
return False
class PlaceHolder(Enum):
GAIN = 1
SR = 2
......
......@@ -408,7 +408,7 @@ class InventoryIm(Inventory):
continue
dl = DLS.get(chan.data_logger.type)
# Geophysical seismic channel use sensor and datalogger
if chan.code[1] in ('H', 'L', 'G','N'):
if hardware.chan_name_is_geophysical(chan.code):
if not (hasattr(chan.sensor, 'type') and
chan.sensor.type in SENSORS.names()):
print ('Sensor not defined, skipping.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment