From f149a48d63e22ef6944742c71912a89bd91416ba Mon Sep 17 00:00:00 2001 From: Mario Hros <966992+k3a@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:09:37 +0200 Subject: [PATCH] support bz2 compression in avhrr_l1b_eps --- satpy/etc/readers/avhrr_l1b_eps.yaml | 1 + satpy/readers/eps_l1b.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/satpy/etc/readers/avhrr_l1b_eps.yaml b/satpy/etc/readers/avhrr_l1b_eps.yaml index fbb4b4ec18..6da619a2da 100644 --- a/satpy/etc/readers/avhrr_l1b_eps.yaml +++ b/satpy/etc/readers/avhrr_l1b_eps.yaml @@ -144,4 +144,5 @@ file_types: file_reader: !!python/name:satpy.readers.eps_l1b.EPSAVHRRFile file_patterns: [ 'AVHR_xxx_1B_{platform_short_name}_{start_time:%Y%m%d%H%M%SZ}_{end_time:%Y%m%d%H%M%SZ}_{processing_mode}_{disposition_mode}_{creation_time:%Y%m%d%H%M%SZ}', + 'AVHR_xxx_1B_{platform_short_name}_{start_time:%Y%m%d%H%M%SZ}_{end_time:%Y%m%d%H%M%SZ}_{processing_mode}_{disposition_mode}_{creation_time:%Y%m%d%H%M%SZ}.bz2', 'AVHR_xxx_1B_{platform_short_name}_{start_time:%Y%m%d%H%M%SZ}_{end_time:%Y%m%d%H%M%SZ}_{processing_mode}_{disposition_mode}_{creation_time:%Y%m%d%H%M%SZ}.nat'] diff --git a/satpy/readers/eps_l1b.py b/satpy/readers/eps_l1b.py index 9ba5dece43..2137eee7d1 100644 --- a/satpy/readers/eps_l1b.py +++ b/satpy/readers/eps_l1b.py @@ -31,6 +31,7 @@ from satpy._config import get_config_path from satpy.readers.file_handlers import BaseFileHandler from satpy.readers.xmlformat import XMLFormat +from satpy.readers.utils import unzip_context from satpy.utils import get_legacy_chunk_size logger = logging.getLogger(__name__) @@ -168,7 +169,8 @@ def __init__(self, filename, filename_info, filetype_info): def _read_all(self): logger.debug("Reading %s", self.filename) - self.sections, self.form = read_records(self.filename) + with unzip_context(self.filename) as fn: + self.sections, self.form = read_records(fn) self.scanlines = self["TOTAL_MDR"] if self.scanlines != len(self.sections[("mdr", 2)]): logger.warning("Number of declared records doesn't match number of scanlines in the file.")