Skip to content

Commit

Permalink
support bz2 compression in avhrr_l1b_eps
Browse files Browse the repository at this point in the history
  • Loading branch information
k3a committed Nov 13, 2024
1 parent c214917 commit f149a48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions satpy/etc/readers/avhrr_l1b_eps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
4 changes: 3 additions & 1 deletion satpy/readers/eps_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit f149a48

Please sign in to comment.