Exemplo n.º 1
0
    def __init__(self, conus_filepath, ndfd_filepath, config, region,
                 **kwargs):
        filetype = kwargs.get('filetype', 'ndfd_static')
        source = kwargs.get('source', config.sources.ndfd.grid)
        registry = kwargs.get('registry', REGBASE)

        self.preInitBuilder(config, 'ndfd_static', source, region, **kwargs)
        self.registry = registry.copy()
        Hdf5GridFileManager.__init__(self, ndfd_filepath, 'w')
        self.initFileAttributes(**kwargs)
        self.postInitBuilder(**kwargs)

        # initiaize file attributes
        self.initFileAttributes(**kwargs)

        # initiaize builder specific attributes
        self.initBuilderAttributes(conus_filepath, **kwargs)

        # create a reader for the CONUS static file
        self.conus_reader = None
        self.conus_filepath = conus_filepath

        # make sure the user has write access
        mode = kwargs.get('mode', 'w')
        if mode == 'w':
            self.load_manager_attrs = False
        else:
            self.load_manager_attrs = True
        self.time_attr_cache = {}
        # close the file to make sure attributes are saved
        self.close()
Exemplo n.º 2
0
 def __init__(self, hdf5_filepath, mode='r'):
     Hdf5GridFileManager.__init__(self, hdf5_filepath, mode)