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

Error when reading MSG native format #189

Closed
ColinDuff opened this issue Feb 13, 2018 · 1 comment
Closed

Error when reading MSG native format #189

ColinDuff opened this issue Feb 13, 2018 · 1 comment

Comments

@ColinDuff
Copy link
Contributor

ColinDuff commented Feb 13, 2018

When trying to load an MSG LEV15 native format file i get the following error

[DEBUG: 2018-02-13 11:29:32 : satpy.scene] Setting 'PPP_CONFIG_DIR' to '/tcenas/home/cduff/MPEF/MPEF_MSG_TOOLS/PYTROLL_DEVELOPMENT/satpy/satpy/etc'
[DEBUG: 2018-02-13 11:29:32 : satpy.readers] Reading ['/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/etc/readers/native_msg.yaml', '/tcenas/home/cduff/MPEF/MPEF_MSG_TOOLS/PYTROLL_DEVELOPMENT/satpy/satpy/etc/readers/native_msg.yaml', '/tcenas/home/cduff/MPEF/MPEF_MSG_TOOLS/PYTROLL_DEVELOPMENT/satpy/satpy/etc/readers/native_msg.yaml']      
[DEBUG: 2018-02-13 11:29:33 : satpy.readers.yaml_reader] Assigning to native_msg: ['/tcenas/home/cduff/PYTROLL_DEV/MSG3-SEVI-MSG15-0100-NA-20170913002740.946000000Z-20170326102757-1214004.nat']
Traceback (most recent call last):
  File "native_msg_test.py", line 26, in <module>
    filenames=[path+fname]
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/scene.py", line 143, in __init__
    reader_kwargs=reader_kwargs)
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/scene.py", line 188, in create_reader_instances
    ppp_config_dir=self.ppp_config_dir)
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/readers/__init__.py", line 412, in load_readers
    reader_instance.create_filehandlers(loadables)
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/readers/yaml_reader.py", line 599, in create_filehandlers
    filename_set)
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/readers/yaml_reader.py", line 588, in new_filehandlers_for_filetype
    return list(filtered_iter)
  File "/tcenas/home/cduff/PYTROLL_DEV/satpy/satpy/readers/yaml_reader.py", line 562, in filter_fh_by_metadata
    filehandler.metadata['start_time'] = filehandler.start_time
AttributeError: 'NativeMSGFileHandler' object has no attribute 'metadata'

The metadata parameter is not being created in the NativeMSGFileHandler class, init function.

1 solution is to call super.__init for the BaseFileHandler class which will create and assign the metadata parameter.

ie

class NativeMSGFileHandler(BaseFileHandler):

    """Native MSG format reader
    """

    def __init__(self, filename, filename_info, filetype_info):
       """ Code the needs to be added """
        super(NativeMSGFileHandler,self).__init__(filename, 
	                                         filename_info, 
	                                         filetype_info)

Also , we (EUMETSAT) have a different filename format for the native msg data so i would like to update the native_msg yaml reader file_patterns to recognise this format

Colin Duff
EUMETSAT

@sjoro
Copy link
Collaborator

sjoro commented May 8, 2018

Fixed and merged to develop

@sjoro sjoro closed this as completed May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants