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

Improve SEVIRI metadata documentation #2915

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: test-environment
mamba-version: "*"
mamba-version: "1.5.10"
channels: conda-forge

- name: Set cache environment variables
Expand Down
22 changes: 17 additions & 5 deletions satpy/readers/seviri_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,21 @@
scn['IR_108']['y'] = mi
scn['IR_108'].sel(time=np.datetime64('2019-03-01T12:06:13.052000000'))

* Raw metadata from the file header can be included by setting the reader
argument ``include_raw_metadata=True`` (HRIT and Native format only). Note
that this comes with a performance penalty of up to 10% if raw metadata from
* HRIT and Native readers can add raw metadata from the file header, such
as calibration coefficients, to dataset attributes. Use the reader keyword
argument ``include_raw_metadata``. Here's an example for extracting
calibration coefficients from Native files.

.. code-block:: python

scene = satpy.Scene(filenames,
reader='seviri_l1b_native',
reader_kwargs={'include_raw_metadata': True})
scene.load(["IR_108"])
mda = scene["IR_108"].attrs["raw_metadata"]
coefs = mda["15_DATA_HEADER"]["RadiometricProcessing"]["Level15ImageCalibration"]

Note that this comes with a performance penalty of up to 10% if raw metadata from
multiple segments or scans need to be combined. By default, arrays with more
than 100 elements are excluded to limit the performance penalty. This
threshold can be adjusted using the ``mda_max_array_size`` reader keyword
Expand All @@ -164,8 +176,8 @@
.. code-block:: python

scene = satpy.Scene(filenames,
reader='seviri_l1b_hrit/native',
reader_kwargs={'include_raw_metadata': True,
reader='seviri_l1b_native',
reader_kwargs={'include_raw_metadata': True,
'mda_max_array_size': 1000})

References:
Expand Down
Loading