def __init__(self, filenames): # At first it should have: lat, lon, dem, linke self.root, is_new = nc.open('static.nc') if is_new: logging.info("This is the first execution from the deployment... ") with nc.loader(filenames[0]) as root_ref: self.lat = nc.getvar(root_ref, 'lat') self.lon = nc.getvar(root_ref, 'lon') nc.getvar(self.root, 'lat', source=self.lat) nc.getvar(self.root, 'lon', source=self.lon) self.project_dem() self.project_linke() nc.sync(self.root) self.root = nc.tailor(self.root, dimensions=DIMS)
def __init__(self, filenames, tile_cut={}): # At first it should have: lat, lon, dem, linke self.root, is_new = nc.open("static.nc") if is_new: logging.info("This is the first execution from the deployment... ") with nc.loader(filenames[0]) as root_ref: self.lat = nc.getvar(root_ref, "lat") self.lon = nc.getvar(root_ref, "lon") nc.getvar(self.root, "lat", source=self.lat) nc.getvar(self.root, "lon", source=self.lon) self.project_dem() self.project_linke() nc.sync(self.root) self.root = nc.tailor(self.root, dimensions=tile_cut)
def __init__(self, filenames): super(Loader, self).__init__() self.filenames = filenames self.root = nc.tailor(filenames, dimensions=DIMS) self.static = StaticCacheConstructor(filenames) self.static_cached = self.static.root
def __init__(self, filenames, tile_cut={}): super(Loader, self).__init__() self.filenames = filenames self.root = nc.tailor(filenames, dimensions=tile_cut) self.static = StaticCacheConstructor(filenames, tile_cut) self.static_cached = self.static.root
def __init__(self, filenames, tile_cut={}, read_only=False): self._attrs = {} self.filenames = filenames self.tile_cut = tile_cut self.root = nc.tailor(filenames, dimensions=tile_cut, read_only=read_only)