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

Merge branch 'geophys_chan_names' into 'master'

Adjust what channel names are considered geophysical channels, and responses fetched from NRL.

See merge request lloyd/nexus!4
parents 5813af47 f880f3f2
No related branches found
No related tags found
1 merge request!4Adjust what channel names are considered geophysical channels, and responses fetched from NRL.
package:
name: nexus-passoft
version: "2020.225"
version: "2021.089"
source:
path: ../
......
......@@ -22,6 +22,28 @@ resp_dir = os.path.join(etc_dir, 'SOH_RESP')
defaultsfile = os.path.join(etc_dir,'nexus.hardware')
def chan_name_is_geophysical(channel_code):
'''
Returns true if channel code is determined to be a waveform which response
should be fetched from the NRL i.e. Not a SOH channel.
'''
band = channel_code[0]
instrument = channel_code[1]
orientation = channel_code[2]
# Band codes from SEED Manual excluding A & O
if band in 'FGDCESHBMLVURPTQ':
# Seismic instrument codes
if instrument in 'HLGNP':
if orientation in 'ZNE12':
return True
# Infrasound / pressure / hydrophone
if instrument in 'D':
if orientation in 'OIDFHU':
return True
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