From d8bae6048c042cdf1563c896f20351b0a42c09e4 Mon Sep 17 00:00:00 2001 From: Stephan Finkensieper Date: Mon, 30 Sep 2024 14:23:11 +0000 Subject: [PATCH 1/3] Improve SEVIRI metadata documentation --- satpy/readers/seviri_base.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/satpy/readers/seviri_base.py b/satpy/readers/seviri_base.py index ace63e3f12..1a98dda098 100644 --- a/satpy/readers/seviri_base.py +++ b/satpy/readers/seviri_base.py @@ -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 @@ -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: From 3d15b3feb232b7317bf69ff20024f32814f6209d Mon Sep 17 00:00:00 2001 From: Stephan Finkensieper Date: Mon, 30 Sep 2024 14:36:34 +0000 Subject: [PATCH 2/3] Fall back to conda --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9f5aa1f73..8bd9f63eaf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,7 @@ jobs: miniforge-version: latest python-version: ${{ matrix.python-version }} activate-environment: test-environment - mamba-version: "*" + # mamba-version: "*" channels: conda-forge - name: Set cache environment variables From 6a4f2afab9d965c1bdc9825c83e1cd98e464748d Mon Sep 17 00:00:00 2001 From: Stephan Finkensieper Date: Mon, 30 Sep 2024 14:46:00 +0000 Subject: [PATCH 3/3] Pin mamba version --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8bd9f63eaf..2cc2948a16 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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