gwpy / gwsumm

Gravitational-wave interferometer summary information system
GNU General Public License v3.0
12 stars 23 forks source link

apply scale factor to channels before plotting #351

Closed rxa254 closed 1 year ago

rxa254 commented 1 year ago

I would like to apply some calibration factor to some of the time series, spectra, specgrams so that I can plot them in units other than the units in which they are written to frames.

e.g. something recorded in volts might be better understood in nTorr or picometers or something

Is there some syntax I can add in the config files to allow this? This is for the 40m summary pages: https://nodus.ligo.caltech.edu:30889/detcharsummary/day/20221025/pem/seismic/

Apologies if this is answered elsewhere. I looked in the docs and issue tracker but didn't find anything obvious.

eagoetz commented 1 year ago

@rxa254 I believe that you can apply the calibration factor like shown here: https://git.ligo.org/detchar/ligo-summary-pages/-/blob/master/configurations/common/sei-ham.ini#L108

Let me know if this is what you need or you are trying to do something different. Note that you cannot do complicated math with bracket or anything like that. The only math allowed is +, -, x, /, **, or ^ (the latter two are just two different ways to do a power). You cannot do something like (A + B)^2.

rxa254 commented 1 year ago

thanks! That's exactly what I was looking for.

In case I wanted to have a common cal file somewhere so that I could load the calibration numbers in, rather than hard code them in the ini files, would you recommend I do that by some import command? Or should I use some sort of text parsing / sed magic to generate the ini files?

eagoetz commented 1 year ago

Having a separate file with calibration factors is not a supported feature, unfortunately. If the calibration changes frequently, then I can see how keeping the ini file updated is a pain. I don't think gwsumm anticipated this kind of frequent updating, so I think your best approach is the text parsing / sed magic for now.

Perhaps it's a useful thing to add to the gwsumm "wish list" for future upgrades

rxa254 commented 1 year ago

thanks, I agree. The cal factors are pretty stable for seismic isolation and suspension things, but would need to be updated for the several of the sensors that receive optical signals since the optical gains can change. I'll think a bit more about if it really deserves to be on the wish list or if its just my sed skills are rusty and I'm lazy :)

areeda commented 1 year ago

Isn't there support for adding affine factors to the frame files? I believe gwpy honors these but I haven't tested it because LIGO doesn't use that feature but Virgo does.

eagoetz commented 1 year ago

I'll close this issue for now as it seems adequately addressed for the needs at the moment, if somewhat imperfectly.