Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Calibration by Meirink et al for SEVIRI #2571

Closed
sfinkens opened this issue Sep 12, 2023 · 6 comments · Fixed by #2589
Closed

Add Calibration by Meirink et al for SEVIRI #2571

sfinkens opened this issue Sep 12, 2023 · 6 comments · Fixed by #2589
Assignees
Labels
component:readers enhancement code enhancements, features, improvements

Comments

@sfinkens
Copy link
Member

Feature Request

Is your feature request related to a problem? Please describe.
In the level1c4pps project we use SEVIRI solar calibration by Meirink et al. As suggested by @mraspaud it would be nice if that was available in Satpy.

Describe the solution you'd like
The easiest solution would be to add a new meirink calibration mode

scene = satpy.Scene(reader_kwargs={"calib_mode": "meirink"}

The coefficients are static, so they can be copied into Satpy. However, then you couldn't combine Meirink for visible and GSICS for IR channels. Alternatively we could go for one calibration mode per channel. For example

calib_mode="meirink" (Meirink for all channels) OR
calib_mode="GSICS" (GSICS for all channels) OR
calib_mode={"VIS006": "meirink", "IR_108": "GSICS"}

Describe any changes to existing user workflow
None

Additional context
None

@sfinkens sfinkens self-assigned this Sep 12, 2023
@sfinkens sfinkens added component:readers enhancement code enhancements, features, improvements labels Sep 12, 2023
@pdebuyl
Copy link
Contributor

pdebuyl commented Sep 19, 2023

Hi @sfinkens (sorry, just again commenting without actual solution).

The "Meirink coefficients" are apparently still OK for Met-10 so far (email with Meirink) but there is not indication of them being definitive. As MSG will keep on operating a few years, would it make sense to "version" them?

For instance:

calib_mode={"VIS006": "meirink", "IR_108": "GSICS"}

would give "whatever is the default in satpy version ${SATPY_VERSION}"

and

calib_mode={"VIS006": "meirink-2024", "IR_108": "GSICS"}

would give the 2024 update of the coefs?

As many instruments could reasonably have a similar versioned set of coefficients, this could be useful.

@sfinkens
Copy link
Member Author

@pdebuyl Thanks for reading all my proposals 😄 Very good idea!

@pdebuyl
Copy link
Contributor

pdebuyl commented Sep 29, 2023

if isinstance(self._calib_mode, dict):
    calib_mode = self._calib_mode[self._channel_name]
else:
    calib_mode = self._calib_mode

in get_gain_offset could work.

Also storing the coefficients in seviri_base.py and adding a helper routine.

A first naive idea is to follow by

if calib_mode == 'GSICS':
    pass
elif calib_mode == 'meirink':
    meirink_gain = coefs['meirink']['gain']
    meirink_offset = coefs['meirink']['offset'] * meirink_gain

but it becomes a bit inflexible as the logic in seviri_base.py (in create_coef_dict for instance) would involve a lot of conditionals for every version of the calibration set. We could (in principle) hope for EUM to publish "climate" quality coefficients for re-use of the original HRIT or native files, which would add one more conditional there.

@pdebuyl
Copy link
Contributor

pdebuyl commented Sep 29, 2023

Not complete yet, I'll propose a draft next week. I did not implement a dict check, it would be two unrelated logic changes in the same proposal.

@gerritholl
Copy link
Collaborator

Should we define the calibration alternatives in a YAML file? As far as they are static coefficients and offsets, those could be directly written there. And/or the YAML file could direct to a Python function that is used for the calibration.

As for a single calibration or one per channel; a split is more flexible and users may want to use something different for solar channels than for terrestrial IR channels.

@pdebuyl
Copy link
Contributor

pdebuyl commented Oct 3, 2023

-> @gerritholl one issue is that those coefficients are time-dependent. So, we'd need a generic way to encore this in the yaml file (from "arbitrary value in file" to actual coefficient that depends on the day of the year).

@pdebuyl pdebuyl mentioned this issue Oct 5, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants