Ticket #169 (new task)
GSE2: apply CALIB during read()
| Reported by: | megies | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | ObsPy library |
| Keywords: | Cc: |
Description
Currently CALIB is not applied when reading GSE2 files.
I talked with Jo and he thinks it should be applied during read() by default (with the possibility to switch this off via a keyword argument).
Attachments
Change History
comment:2 Changed 17 months ago by beyreuth
I think it is a good idea to have a keyword argument. I see the following pitfalls:
- GSE2 stores the data as int32, multiplying by calib calper will transfer them to float, writing them to other int32 formats can result in changed data, which I think is good to circumvent. It has also a computation cost overhead.
- to stay consistent, we would need to do this for all formats, especially when we would set the option default to true
- it will get even more confusing to use the attach_paz fct in libgse2, you need to control of the calib calper was applied before
- what happens if someone did not apply the pi factor for calib (e.g. old baynets) => the data get corrupted
Therefore, I understand the reasons why to apply it on read, however, I suggest the default to false permanently.
comment:3 Changed 17 months ago by beyreuth
Another problem by doing the calib calper correction is that ObsPy starts to do magic:
- for GSE2 the calib is corrected
- for MiniSEED not, as it does not store the calib factor
That is the user need to know the format details to know if there are actually volt or count. I really think that the default should be False and stay False in the future.
comment:4 Changed 16 months ago by barsch
-1 for "default=True"
IMHO to much magic - we shouldn't change the original data format!
--- a bit off: keywords should always be lower case and seperated with underscore - so please call the option apply_calibration or something similar
comment:5 Changed 16 months ago by krischer
I also vote for setting the default value to false. I think that so far in all similar cases we chose to not modify the original data and leave that job to the user in case it is necessary.
Also a simple
read GSE2 -> trim -> write GSE2
would be nearly impossible without modifying the data slightly if the calibration factor is applied.
comment:6 Changed 16 months ago by krischer
I wrote a small script to figure out whether or not applying a single precission floating point calibration factor might irreversibly change any integer values, e.g. if
some_integer = (some_integer * some_float) / some_float
I let it run for about 40E9 combinations and not a single one failed if the result is rounded before it is transformed back to integer data. Without rounding about 0.5 % of the data values changed by 1.


suggestion:
opinions?