Sensor_keys and datalogger_keys syntax

Dear Forum,

my first attempt at creating stationxml stations with Obspy, please bear with me.
I am having trouble finding guidelines on the syntax of the sensor_keys and datalogger_keys.
I am using NRLvl2 offline. In a particular case, I tried

response = nrl.get_response(
sensor_keys=[‘Nanometrics’, ‘Trillium Compact 120 (Vault, Posthole, OBS)’, ‘754 V/m/s’]

and got the error message

(obspy) joao@msi:~$ python create_station_xml_AO_Trillium.sh
File “/home/joao/create_station_xml_AO_Trillium.sh”, line 131
sensor_keys=[‘Nanometrics’, ‘Trillium Compact 120 (Vault, Posthole, OBS)’, ‘754 V/m/s’]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

At present my particular case concerns a station with a Trillium Compact and Centaur as per above example, but I also need to create stationxml files for other combinations. I explored obspy.nrl.clients but could’t find guidance. Are there any general syntax rules that apply to sensor_keys and datalogger_keys?

Hi, judging from what you posted, your command is missing a closing paranthesis at the end of the line )
SyntaxError: invalid syntax has nothing to do with any ObsPy specifics, its just a general Python problem.

Sorry, the closing parenthesis was below, after the datalogger_keys line (not included in the previous post):

response = nrl.get_response(
sensor_keys=[‘Nanometrics’, ‘Trillium Compact 120 (Vault, Posthole, OBS)’, ‘754 V/m/s’]
datalogger_keys=[‘Nanometrics’ , ‘Centaur’ , ‘1Vpp’ ,‘50 Hz’ , ‘Off’ , ‘Linear’])

I understand that the SyntaxError: invalid syntax is not Obspy specific. Still, I would appreciate if you could point me to some guidelines concerning the syntax to use in the sensor and datalogger parameters.
Cheers

So now, from looking at what you posted, it looks to be exactly what the error message said, there seems to be a missing comma after sensor_keys to separate the keyword arguments in the function call :wink:

nrl.get_response(
sensor_keys=[...],
datalogger_keys=[...])