iris-edu / yasmine-stationxml-editor

GNU General Public License v3.0
13 stars 4 forks source link

python warnings about computed sensitivities not bubbling up to UI #47

Open rcasey-earthscope opened 9 months ago

rcasey-earthscope commented 9 months ago

When using the NRL tool, I randomly selected a sensor and datalogger and when complete, the text window showed warnings that the user won't see if they are looking at the UI tool.

yasmine-backend | INFO:tornado.access:200 GET /api/nrl/sensor/response/?_dc=1709596356953&keys=SeismoWave&keys=MB3a&keys=100%20s&keys=27%20Hz (172.18.0.3) 132.79ms yasmine-backend | /usr/local/lib/python3.12/site-packages/obspy/clients/nrl/client.py:267: UserWarning: Failed to recalculate overall sensitivity. yasmine-backend | warnings.warn(msg) yasmine-backend | /usr/local/lib/python3.12/site-packages/obspy/core/inventory/response.py:1935: UserWarning: More than one PolesZerosResponseStage encountered. Returning first one found. yasmine-backend | warnings.warn(msg) yasmine-backend | WARNING (norm_resp): computed and reported sensitivities differ by more than 5 percent. yasmine-backend | Execution continuing. yasmine-backend | WARNING:matplotlib.legend:No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument. yasmine-backend | WARNING (norm_resp): computed and reported sensitivities differ by more than 5 percent. yasmine-backend | Execution continuing.

This came from a pairing of: Datalogger: SARA, SL0632, active, 40Vpp, 30 Sensor: Seismowave, MB3a, 100s

It should be noted that the response does plot in the tool.

metempleton commented 8 months ago

Great sleuthing Rob! There are at least two needed changes unearthed here.

Yasmine should not restrict the number of PAZ elements in a response. The first found is the sensor and the second is an analog anti-alias filter in the datalogger. This combination happens often enough in seismic recording. And because EarthScope is diversifying the instrumentation in our archive, I believe that response rules that describe most, but not all, seismic instrumentation is not helpful for us. I can create an issue ticket for this. I ran into another similar instance in which Yasmine requires having one PAZ element in every response, which blocks SOH response info.

The warning about computed and reported sensitivities differing appears to be linked to how Yasmine is computing total sensitivity. Yasmine is using individual responses from the full zip file, so it has to stitch sensor and datalogger together and calculate total sensitivity at some frequency. On the other hand, the NRL ws does this for you if you request 2 responses as a cascade. When I pulled the instrument you describe from the ws:

https://service.iris.edu/irisws/nrl/1/combine?instconfig=sensor_SeismoWave_MB3a_LP100_HF27_SG0.02_STairPressure:datalogger_SARA_SL0632_FTactive_FV40Vpp_AB30_FR100&format=resp&nodata=404

total sensitivity matches closely (computed/calculated). So I believe that difference is originating in Yasmine and is related to using a local zip library vs the ws.

rcasey-earthscope commented 8 months ago
Thank you for this analysis, Mary.  Yes, please create another issue for that one.  The issue should then get filed under P0 as it sounds like it's necessary in order for us to achieve some level of readiness for old NRL retirement.  

I am fine with us going with the bulk .zip NRL file download solution in order to make the April deadline.  Omid is working on a Python library that might (hopefully) use the web service for all of these functions instead.  He is still in the early stages of work, but he has to have it done by end of April as NEXUS will be affected.  I would like to see how we can then port his code to Yasmine, which will be a Phase 2 effort.

-Rob

On Mar 5, 2024, at 7:33 AM, Mary Templeton @.***> wrote:

Great sleuthing Rob! There are at least two needed changes to be unearthed here.

Yasmine should not restrict the number of PAZ elements in a response. The first found is the sensor and the second is an analog anti-alias filter in the datalogger. This combination happens often enough in seismic recording. And because EarthScope is diversifying the instrumentation in our archive, I believe that response rules that describe most, but not all, seismic instrumentation is not helpful for us. I can create an issue ticket for this. I ran into another similar instance in which Yasmine requires having one PAZ element in every response, which blocks SOH response info.

The warning about computed and reported sensitivities differing appears to be linked to how Yasmine is computing total sensitivity. Yasmine is using individual responses from the full zip file, so it has to stitch sensor and datalogger together and calculate total sensitivity at some frequency. On the other hand, the NRL ws does this for you if you request 2 responses as a cascade. When I pulled the instrument you describe from the ws:

https://service.iris.edu/irisws/nrl/1/combine?instconfig=sensor_SeismoWave_MB3a_LP100_HF27_SG0.02_STairPressure:datalogger_SARA_SL0632_FTactive_FV40Vpp_AB30_FR100&format=resp&nodata=404

total sensitivity matches closely (compunted/calculated). So I believe that difference is originating in Yasmine and is related to using a local zip library vs the ws.

— Reply to this email directly, view it on GitHub https://github.com/iris-edu/yasmine-stationxml-editor/issues/47#issuecomment-1979045374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFL4VN3VALZSVABGMKJU25DYWXQVRAVCNFSM6AAAAABEGEECUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZGA2DKMZXGQ. You are receiving this because you authored the thread.