Esempio 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()
Esempio n. 2
0
 def conusReader(self):
     if self.conus_reader is None:
         conus_reader = Hdf5GridFileManager(self.conus_filepath, 'r')
         conus_reader.lats = conus_reader.getData('lat')
         conus_reader.lons = conus_reader.getData('lon')
         self.conus_reader = conus_reader
     elif not self.conus_reader.isOpen():
         self.conus_reader.open('r')
         conus_reader = self.conus_reader
         conus_reader.lats = conus_reader.getData('lat')
         conus_reader.lons = conus_reader.getData('lon')
     return self.conus_reader
Esempio n. 3
0
 def _loadManagerAttributes_(self):
     Hdf5GridFileManager._loadManagerAttributes_(self)
     self._loadDataGridAttributes_()
Esempio n. 4
0
 def __init__(self, hdf5_filepath, mode='r'):
     Hdf5GridFileManager.__init__(self, hdf5_filepath, mode)
Esempio n. 5
0
 def _loadManagerAttributes_(self):
     Hdf5GridFileManager._loadManagerAttributes_(self)
     self._loadProjectFileAttributes_()