after_merge
stringlengths
28
79.6k
before_merge
stringlengths
20
79.6k
url
stringlengths
38
71
full_traceback
stringlengths
43
922k
traceback_type
stringclasses
555 values
def save_datasets(self, datasets, filename, **kwargs): """Save all datasets to one or more files.""" logger.info("Saving datasets to NetCDF4/CF.") datas, start_times, end_times = self._collect_datasets(datasets, kwargs) dataset = xr.Dataset(datas) try: dataset["time_bnds"] = make_time_boun...
def save_datasets(self, datasets, filename, **kwargs): """Save all datasets to one or more files.""" LOG.info("Saving datasets to NetCDF4/CF.") ds_collection = {} for ds in datasets: ds_collection.update(get_extra_ds(ds)) datas = {} for ds in ds_collection.values(): try: ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __str__(self): from pprint import pformat return pformat(self.attrs)
def __str__(self): from pprint import pformat return pformat(self.info)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __repr__(self): from pprint import pformat return pformat(self.attrs)
def __repr__(self): from pprint import pformat return pformat(self.info)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def apply_modifier_info(self, origin, destination): o = getattr(origin, "attrs", origin) d = getattr(destination, "attrs", destination) for k in DATASET_KEYS: if k == "modifiers": d[k] = self.attrs[k] elif d.get(k) is None: if self.attrs.get(k) is not None: ...
def apply_modifier_info(self, origin, destination): o = getattr(origin, "info", origin) d = getattr(destination, "info", destination) for k in DATASET_KEYS: if k == "modifiers": d[k] = self.info[k] elif d.get(k) is None: if self.info.get(k) is not None: ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, **info): vis = projectables[0] if vis.attrs.get("sunz_corrected"): LOG.debug("Sun zen correction already applied") return vis if hasattr(vis.attrs["area"], "name"): area_name = vis.attrs["area"].name else: area_name = "swath" + str(vis.sh...
def __call__(self, projectables, **info): vis = projectables[0] if vis.info.get("sunz_corrected"): LOG.debug("Sun zen correction already applied") return vis if hasattr(vis.info["area"], "name"): area_name = vis.info["area"].name else: area_name = "swath" + str(vis.shape...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): """Get the corrected reflectance when removing Rayleigh scattering. Uses pyspectral. """ from pyspectral.rayleigh import Rayleigh (vis, red) = projectables if vis.shape != red.shape: raise IncompatibleAreas try: ...
def __call__(self, projectables, optional_datasets=None, **info): """Get the corrected reflectance when removing Rayleigh scattering. Uses pyspectral. """ from pyspectral.rayleigh import Rayleigh (vis, red) = projectables if vis.shape != red.shape: raise IncompatibleAreas try: ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _init_refl3x(self, projectables): """Initiate the 3.x reflectance derivations""" try: from pyspectral.near_infrared_reflectance import Calculator except ImportError: LOG.info("Couldn't load pyspectral") raise _nir, _tb11 = projectables self._refl3x = Calculator( ...
def _init_refl3x(self, projectables): """Initiate the 3.x reflectance derivations""" try: from pyspectral.near_infrared_reflectance import Calculator except ImportError: LOG.info("Couldn't load pyspectral") raise _nir, _tb11 = projectables self._refl3x = Calculator( ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _get_reflectance(self, projectables, optional_datasets): """Calculate 3.x reflectance with pyspectral""" _nir, _tb11 = projectables LOG.info("Getting reflective part of %s", _nir.attrs["name"]) sun_zenith = None tb13_4 = None for dataset in optional_datasets: if ( datas...
def _get_reflectance(self, projectables, optional_datasets): """Calculate 3.x reflectance with pyspectral""" _nir, _tb11 = projectables LOG.info("Getting reflective part of %s", _nir.info["name"]) sun_zenith = None tb13_4 = None for dataset in optional_datasets: if ( dataset...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): """Get the emissive part an NIR channel after having derived the reflectance. Not supposed to be used for wavelength outside [3, 4] µm. """ self._init_refl3x(projectables) # Derive the sun-zenith angles, and use the nir and thermal ir...
def __call__(self, projectables, optional_datasets=None, **info): """Get the emissive part an NIR channel after having derived the reflectance. Not supposed to be used for wavelength outside [3, 4] µm. """ self._init_refl3x(projectables) # Derive the sun-zenith angles, and use the nir and thermal ir...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): """Get the atmospherical correction. Uses pyspectral.""" from pyspectral.atm_correction_ir import AtmosphericalCorrection band = projectables[0] if optional_datasets: satz = optional_datasets[0] else: from pyorbital....
def __call__(self, projectables, optional_datasets=None, **info): """Get the atmospherical correction. Uses pyspectral.""" from pyspectral.atm_correction_ir import AtmosphericalCorrection band = projectables[0] if optional_datasets: satz = optional_datasets[0] else: from pyorbital....
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): """CO2 correction of the brightness temperature of the MSG 3.9um channel. .. math:: T4_CO2corr = (BT(IR3.9)^4 + Rcorr)^0.25 Rcorr = BT(IR10.8)^4 - (BT(IR10.8)-dt_CO2)^4 dt_CO2 = (BT(IR10.8)-BT(IR13.4))/4.0 """ (ir_...
def __call__(self, projectables, optional_datasets=None, **info): """CO2 correction of the brightness temperature of the MSG 3.9um channel. .. math:: T4_CO2corr = (BT(IR3.9)^4 + Rcorr)^0.25 Rcorr = BT(IR10.8)^4 - (BT(IR10.8)-dt_CO2)^4 dt_CO2 = (BT(IR10.8)-BT(IR13.4))/4.0 """ (ir_...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) info = combine_metadata(*projectables) info["name"] = self.attrs["name"] return Dataset(projectables[0] - projectables[1], **info)
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) info = combine_info(*projectables) info["name"] = self.info["name"] return Dataset(projectables[0] - projectables[1], **info)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(projectables),)) areas = [projectable.attrs.get("area", None) for projectable in projectables] areas = [area for area in areas if area is not None] if...
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(projectables),)) try: the_data = np.rollaxis( np.ma.dstack([projectable for projectable in projectables]), axis=2 ) except Val...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def build_colormap(palette, dtype, info): """Create the colormap from the `raw_palette` and the valid_range.""" from trollimage.colormap import Colormap palette = np.asanyarray(palette).squeeze() if dtype == np.dtype("uint8"): tups = [(val, tuple(tup)) for (val, tup) in enumerate(palette[:-1])...
def build_colormap(palette, dtype, info): """Create the colormap from the `raw_palette` and the valid_range.""" from trollimage.colormap import Colormap if dtype == np.dtype("uint8"): tups = [(val, tuple(tup)) for (val, tup) in enumerate(palette[:-1])] colormap = Colormap(*tups) elif ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) # TODO: support datasets with palette to delegate this to the image # writer. data, palette = projectables palette = np.asanyarray(palette).squeeze() ...
def __call__(self, projectables, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) # TODO: support datasets with palette to delegate this to the image # writer. data, palette = projectables colormap = self.build_colormap(palette / 25...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) # TODO: support datasets with palette to delegate this to the image # writer. data, palette = projectables palette = np.asanyarray(palette).squeeze() ...
def __call__(self, projectables, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) # TODO: support datasets with palette to delegate this to the image # writer. data, palette = projectables palette = palette / 255.0 colormap = se...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, *args, **kwargs): try: vis06 = projectables[0] vis08 = projectables[1] hrv = projectables[2] try: ch3 = 3 * hrv - vis06 - vis08 ch3.attrs = hrv.attrs except ValueError as err: raise IncompatibleAreas ...
def __call__(self, projectables, *args, **kwargs): try: vis06 = projectables[0] vis08 = projectables[1] hrv = projectables[2] ndvi = (vis08 - vis06) / (vis08 + vis06) ndvi = np.where(ndvi < 0, 0, ndvi) # info = combine_info(*projectables) # info['name'] = se...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, **info): c01, c02, c03 = projectables # c02 = c02.sel(x=c01.coords['x'], y=c01.coords[ # 'y'], method='nearest', tolerance=0.1) r = c02[::2, ::2] b = c01 r.coords["x"] = b.coords["x"] r.coords["y"] = b.coords["y"] r.data = r.data.rechunk(b...
def __call__(self, projectables, **info): c01, c02, c03 = projectables r = c02 b = c01 g = simulated_green(c01, c02, c03) return super(TrueColor2km, self).__call__((r, g, b), **info)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): factor = self.attrs.get("factor", 2) (band,) = projectables LOG.info("Expanding datasize by a factor %d.", factor) proj = Dataset( np.repeat(np.repeat(band, factor, axis=0), factor, axis=1), copy=False, **band.i...
def __call__(self, projectables, optional_datasets=None, **info): factor = self.info.get("factor", 2) (band,) = projectables LOG.info("Expanding datasize by a factor %d.", factor) proj = Dataset( np.repeat(np.repeat(band, factor, axis=0), factor, axis=1), copy=False, **band.in...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 2 LOG.info("Reducing datasize by a factor %d.", factor) proj = band[::factor, ::factor] # newshape = (band.shape[0] / factor, factor, # band.shape[1] / factor, factor) # proj = Dat...
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 2 LOG.info("Reducing datasize by a factor %d.", factor) proj = Dataset(band[::factor, ::factor], copy=False, **band.info) # newshape = (band.shape[0] / factor, factor, # band.shape[1] ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 4 LOG.info("Reducing datasize by a factor %d.", factor) proj = band[::factor, ::factor] # newshape = (band.shape[0] / factor, factor, # band.shape[1] / factor, factor) # proj = Da...
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 4 LOG.info("Reducing datasize by a factor %d.", factor) proj = Dataset(band[::factor, ::factor], copy=False, **band.info) # newshape = (band.shape[0] / factor, factor, # band.shape[1] ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 8 LOG.info("Reducing datasize by a factor %d.", factor) proj = band[::factor, ::factor] # newshape = (band.shape[0] / factor, factor, # band.shape[1] / factor, factor) # proj = Da...
def __call__(self, projectables, optional_datasets=None, **info): (band,) = projectables factor = 8 LOG.info("Reducing datasize by a factor %d.", factor) proj = Dataset(band[::factor, ::factor], copy=False, **band.info) # newshape = (band.shape[0] / factor, factor, # band.shape[1] ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, *args, **kwargs): """Create the SAR Ice composite.""" (mhh, mhv) = projectables green = overlay(mhh, mhv) green.info = combine_metadata(mhh, mhv) return super(SARIce, self).__call__((mhv, green, mhh), *args, **kwargs)
def __call__(self, projectables, *args, **kwargs): """Create the SAR Ice composite.""" (mhh, mhv) = projectables green = overlay(mhh, mhv) green.info = combine_info(mhh, mhv) return super(SARIce, self).__call__((mhv, green, mhh), *args, **kwargs)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) p1, p2 = projectables fog = p1 - p2 fog.info.update(self.attrs) fog.info["area"] = p1.info["area"] fog.info["start_time"] = p...
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 2: raise ValueError("Expected 2 datasets, got %d" % (len(projectables),)) p1, p2 = projectables fog = p1 - p2 fog.info.update(self.info) fog.info["area"] = p1.info["area"] fog.info["start_time"] = p1...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(projectables),)) # Collect information that is the same between the projectables info = combine_metadata(*projectables) # Update that information with...
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(projectables),)) # Collect information that is the same between the projectables info = combine_info(*projectables) # Update that information with con...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, optional_datasets=None, **info): if len(datasets) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(datasets),)) area = None n = {} p1, p2, p3 = datasets if optional_datasets: high_res = optional_datasets[0] low_res = datasets[["red", "...
def __call__(self, datasets, optional_datasets=None, **info): if len(datasets) != 3: raise ValueError("Expected 3 datasets, got %d" % (len(datasets),)) area = None n = {} p1, p2, p3 = datasets if optional_datasets: high_res = optional_datasets[0] low_res = datasets[["red", "...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, **info): refl_data, sensor_aa, sensor_za, solar_aa, solar_za = datasets if refl_data.attrs.get("rayleigh_corrected"): return refl_data if os.path.isfile(self.dem_file): LOG.debug( "Loading CREFL averaged elevation information from: %s", self.dem_file...
def __call__(self, datasets, **info): refl_data, sensor_aa, sensor_za, solar_aa, solar_za = datasets if refl_data.info.get("rayleigh_corrected"): return refl_data if os.path.isfile(self.dem_file): LOG.debug( "Loading CREFL averaged elevation information from: %s", self.dem_file ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, **info): """Create the composite by scaling the DNB data using a histogram equalization method. :param datasets: 2-element tuple (Day/Night Band data, Solar Zenith Angle data) :param **info: Miscellaneous metadata for the newly produced composite """ if len(datasets) !=...
def __call__(self, datasets, **info): """Create the composite by scaling the DNB data using a histogram equalization method. :param datasets: 2-element tuple (Day/Night Band data, Solar Zenith Angle data) :param **info: Miscellaneous metadata for the newly produced composite """ if len(datasets) !=...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, **info): """Create the composite by scaling the DNB data using an adaptive histogram equalization method. :param datasets: 2-element tuple (Day/Night Band data, Solar Zenith Angle data) :param **info: Miscellaneous metadata for the newly produced composite """ if len(da...
def __call__(self, datasets, **info): """Create the composite by scaling the DNB data using an adaptive histogram equalization method. :param datasets: 2-element tuple (Day/Night Band data, Solar Zenith Angle data) :param **info: Miscellaneous metadata for the newly produced composite """ if len(da...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, **info): if len(datasets) != 4: raise ValueError("Expected 4 datasets, got %d" % (len(datasets),)) from scipy.special import erf dnb_data = datasets[0] sza_data = datasets[1] lza_data = datasets[2] good_mask = ~(dnb_data.mask | sza_data.mask) output_dat...
def __call__(self, datasets, **info): if len(datasets) != 4: raise ValueError("Expected 4 datasets, got %d" % (len(datasets),)) from scipy.special import erf dnb_data = datasets[0] sza_data = datasets[1] lza_data = datasets[2] good_mask = ~(dnb_data.mask | sza_data.mask) output_dat...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, datasets, **info): if len(datasets) != 4: raise ValueError("Expected 4 datasets, got %d" % (len(datasets),)) dnb_data = datasets[0] sza_data = datasets[1] lza_data = datasets[2] # good_mask = ~(dnb_data.mask | sza_data.mask) # output_dataset = dnb_data.copy() # ou...
def __call__(self, datasets, **info): if len(datasets) != 4: raise ValueError("Expected 4 datasets, got %d" % (len(datasets),)) dnb_data = datasets[0] sza_data = datasets[1] lza_data = datasets[2] # good_mask = ~(dnb_data.mask | sza_data.mask) # output_dataset = dnb_data.copy() # ou...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 5: raise ValueError("Expected 5 datasets, got %d" % (len(projectables),)) # Collect information that is the same between the projectables info = combine_metadata(*projectables) # Update that information with...
def __call__(self, projectables, nonprojectables=None, **info): if len(projectables) != 5: raise ValueError("Expected 5 datasets, got %d" % (len(projectables),)) # Collect information that is the same between the projectables info = combine_info(*projectables) # Update that information with con...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def name_match(a, b): """Return if two string names are equal. Args: a (str): DatasetID.name or other string b (str): DatasetID.name or other string """ return a == b
def name_match(a, b): """Return if two string names are equal Args: a (str): DatasetID.name or other string b (str): DatasetID.name or other string """ return a == b
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def wavelength_match(a, b): """Return if two wavelengths are equal. Args: a (tuple or scalar): (min wl, nominal wl, max wl) or scalar wl b (tuple or scalar): (min wl, nominal wl, max wl) or scalar wl """ if type(a) == ( type(b) or isinstance(a, numbers.Number) and isinstance(b, ...
def wavelength_match(a, b): """Return if two wavelengths are equal Args: a (tuple or scalar): (min wl, nominal wl, max wl) or scalar wl b (tuple or scalar): (min wl, nominal wl, max wl) or scalar wl """ if ( type(a) == type(b) or isinstance(a, numbers.Number) and...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __lt__(self, other): """Less than.""" """Compare DatasetIDs with special handling of `None` values""" # modifiers should never be None when sorted, should be tuples if isinstance(other, DatasetID): other = other._comparable() return super(DatasetID, self._comparable()).__lt__(other)
def __lt__(self, other): """Compare DatasetIDs with special handling of `None` values""" # modifiers should never be None when sorted, should be tuples if isinstance(other, DatasetID): other = other._comparable() return super(DatasetID, self._comparable()).__lt__(other)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __eq__(self, other): """Check for equality.""" if isinstance(other, str): return self.name_match(self.name, other) elif ( isinstance(other, numbers.Number) or isinstance(other, (tuple, list)) and len(other) == 3 ): return self.wavelength_match(self.wavelength,...
def __eq__(self, other): if isinstance(other, str): return self.name_match(self.name, other) elif ( isinstance(other, numbers.Number) or isinstance(other, (tuple, list)) and len(other) == 3 ): return self.wavelength_match(self.wavelength, other) else: retu...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __hash__(self): """Generate the hash of the ID.""" return tuple.__hash__(self)
def __hash__(self): return tuple.__hash__(self)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def from_dict(cls, d, **kwargs): """Convert a dict to an ID.""" args = [] for k in DATASET_KEYS: val = kwargs.get(k, d.get(k)) # force modifiers to tuple if k == "modifiers" and val is not None: val = tuple(val) args.append(val) return cls(*args)
def from_dict(cls, d, **kwargs): args = [] for k in DATASET_KEYS: val = kwargs.get(k, d.get(k)) # force modifiers to tuple if k == "modifiers" and val is not None: val = tuple(val) args.append(val) return cls(*args)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def to_dict(self, trim=True): """Convert the ID to a dict.""" if trim: return self._to_trimmed_dict() else: return dict(zip(DATASET_KEYS, self))
def to_dict(self, trim=True): if trim: return self._to_trimmed_dict() else: return dict(zip(DATASET_KEYS, self))
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, **attributes): """Initialize the class with *attributes*.""" self.attrs = attributes
def __init__(self, **attributes): self.info = attributes
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def id(self): """Return the DatasetID of the object.""" return DatasetID.from_dict(self.attrs)
def id(self): return DatasetID.from_dict(self.info)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _find_compositor( self, dataset_key, calibration=None, polarization=None, resolution=None ): """Find the compositor object for the given dataset_key.""" # NOTE: This function can not find a modifier that performs one or more modifications # if it has modifiers see if we can find the unmodified versi...
def _find_compositor( self, dataset_key, calibration=None, polarization=None, resolution=None ): """Find the compositor object for the given dataset_key.""" # NOTE: This function can not find a modifier that performs one or more modifications # if it has modifiers see if we can find the unmodified versi...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __setitem__(self, key, value): """Support assigning 'Dataset' objects or dictionaries of metadata.""" d = value if hasattr(value, "attrs"): # xarray.DataArray objects d = value.attrs # use value information to make a more complete DatasetID if not isinstance(key, DatasetID): ...
def __setitem__(self, key, value): """Support assigning 'Dataset' objects or dictionaries of metadata.""" d = value.info if hasattr(value, "info") else value if not isinstance(key, DatasetID): old_key = key key = self.get_key(key) if key is None: if isinstance(old_key, (s...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def load_readers( filenames=None, reader=None, reader_kwargs=None, ppp_config_dir=get_environ_config_dir(), ): """Create specified readers and assign files to them. Args: filenames (iterable or dict): A sequence of files that will be used to load data from. A ``dict`` object ...
def load_readers( filenames=None, reader=None, reader_kwargs=None, ppp_config_dir=get_environ_config_dir(), ): """Create specified readers and assign files to them. Args: filenames (iterable or dict): A sequence of files that will be used to load data from. A ``dict`` object ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info): """Get a dataset from the file.""" if key.name in CHANNEL_NAMES: dataset = self.calibrate([key])[0] elif key.name in ["longitude", "latitude"]: if self.lons is None or self.lats is None: self.navigate() if key.name == "longitude": ...
def get_dataset(self, key, info): """Get a dataset from the file.""" if key.name in CHANNEL_NAMES: dataset = self.calibrate([key])[0] # dataset.info.update(info) elif key.name in ["longitude", "latitude"]: if self.lons is None or self.lats is None: self.navigate() ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_angles(self, angle_id): """Get sun-satellite viewing angles""" tic = datetime.now() sunz40km = self._data["ang"][:, :, 0] * 1e-2 satz40km = self._data["ang"][:, :, 1] * 1e-2 azidiff40km = self._data["ang"][:, :, 2] * 1e-2 try: from geotiepoints.interpolator import Interpolator...
def get_angles(self, angle_id): """Get sun-satellite viewing angles""" tic = datetime.now() sunz40km = self._data["ang"][:, :, 0] * 1e-2 satz40km = self._data["ang"][:, :, 1] * 1e-2 azidiff40km = self._data["ang"][:, :, 2] * 1e-2 try: from geotiepoints.interpolator import Interpolator...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, dataset_ids, pre_launch_coeffs=False, calib_coeffs=None): """Calibrate the data""" tic = datetime.now() if calib_coeffs is None: calib_coeffs = {} chns = dict((dataset_id.name, dataset_id) for dataset_id in dataset_ids) res = [] # FIXME this should be done in _vis_...
def calibrate(self, dataset_ids, pre_launch_coeffs=False, calib_coeffs=None): """Calibrate the data""" tic = datetime.now() if calib_coeffs is None: calib_coeffs = {} chns = dict((dataset_id.name, dataset_id) for dataset_id in dataset_ids) res = [] # FIXME this should be done in _vis_...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, filename, filename_info, filetype_info): super(NC_ABI_L1B, self).__init__(filename, filename_info, filetype_info) self.nc = xr.open_dataset( filename, decode_cf=True, mask_and_scale=True, engine="h5netcdf", chunks={"x": 1000, "y": 1000}, ) self....
def __init__(self, filename, filename_info, filetype_info): super(NC_ABI_L1B, self).__init__(filename, filename_info, filetype_info) self.nc = h5netcdf.File(filename, "r") platform_shortname = filename_info["platform_shortname"] self.platform_name = PLATFORM_NAMES.get(platform_shortname) self.senso...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info, xslice=slice(None), yslice=slice(None)): """Load a dataset.""" logger.debug("Reading in get_dataset %s.", key.name) radiances = self.nc["Rad"][xslice, yslice].expand_dims("time") res = self.calibrate(radiances) # convert to satpy standard units if res.attrs["u...
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): """Load a dataset.""" logger.debug("Reading in get_dataset %s.", key.name) variable = self.nc["Rad"] radiances = ( np.ma.masked_equal( variable[yslice, xslice], variable.attrs["_FillValue"], copy=Fa...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_area_def(self, key): """Get the area definition of the data at hand.""" projection = self.nc["goes_imager_projection"] a = projection.attrs["semi_major_axis"] h = projection.attrs["perspective_point_height"] b = projection.attrs["semi_minor_axis"] lon_0 = projection.attrs["longitude_of_...
def get_area_def(self, key): """Get the area definition of the data at hand.""" projection = self.nc["goes_imager_projection"] a = projection.attrs["semi_major_axis"][...] h = projection.attrs["perspective_point_height"][...] b = projection.attrs["semi_minor_axis"][...] lon_0 = projection.attrs[...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _vis_calibrate(self, data): """Calibrate visible channels to reflectance.""" solar_irradiance = self.nc["esun"] esd = self.nc["earth_sun_distance_anomaly_in_AU"].astype(float) factor = np.pi * esd * esd / solar_irradiance res = data * factor res.attrs = data.attrs res.attrs["units"] = ...
def _vis_calibrate(self, data): """Calibrate visible channels to reflectance.""" solar_irradiance = self.nc["esun"][()] esd = self.nc["earth_sun_distance_anomaly_in_AU"][()] factor = np.pi * esd * esd / solar_irradiance data.data[:] *= factor return "1"
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _ir_calibrate(self, data): """Calibrate IR channels to BT.""" fk1 = float(self.nc["planck_fk1"]) fk2 = float(self.nc["planck_fk2"]) bc1 = float(self.nc["planck_bc1"]) bc2 = float(self.nc["planck_bc2"]) res = (fk2 / xu.log(fk1 / data + 1) - bc1) / bc2 res.attrs = data.attrs res.attrs...
def _ir_calibrate(self, data): """Calibrate IR channels to BT.""" fk1 = self.nc["planck_fk1"][()] fk2 = self.nc["planck_fk2"][()] bc1 = self.nc["planck_bc1"][()] bc2 = self.nc["planck_bc2"][()] np.divide(fk1, data, out=data.data) data.data[:] += 1 np.log(data, out=data.data) np.divi...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, data): """Calibrate the data.""" logger.debug("Calibrate") ch = int(self.nc["band_id"]) if ch < 7: return self._vis_calibrate(data) else: return self._ir_calibrate(data)
def calibrate(self, data): """Calibrate the data.""" logger.debug("Calibrate") ch = self.nc["band_id"][()] if ch < 7: return self._vis_calibrate(data) else: return self._ir_calibrate(data)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def start_time(self): return datetime.strptime( self.nc.attrs["time_coverage_start"], "%Y-%m-%dT%H:%M:%S.%fZ" )
def start_time(self): return datetime.strptime( self.nc.attrs["time_coverage_start"].decode(), "%Y-%m-%dT%H:%M:%S.%fZ" )
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def end_time(self): return datetime.strptime( self.nc.attrs["time_coverage_end"], "%Y-%m-%dT%H:%M:%S.%fZ" )
def end_time(self): return datetime.strptime( self.nc.attrs["time_coverage_end"].decode(), "%Y-%m-%dT%H:%M:%S.%fZ" )
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_shape(self, ds_id, ds_info): """Get numpy array shape for the specified dataset. Args: ds_id (DatasetID): ID of dataset that will be loaded ds_info (dict): Dictionary of dataset information from config file Returns: tuple: (rows, cols) """ var_path = ds_info.get("f...
def get_shape(self, ds_id, ds_info): """Get numpy array shape for the specified dataset. Args: ds_id (DatasetID): ID of dataset that will be loaded ds_info (dict): Dictionary of dataset information from config file Returns: tuple: (rows, cols) """ var_path = ds_info.get("f...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, dataset_id, ds_info, xslice=slice(None), yslice=slice(None)): """Load data array and metadata from file on disk.""" var_path = ds_info.get("file_key", "{}".format(dataset_id.name)) metadata = self.get_metadata(dataset_id, ds_info) shape = metadata["shape"] file_shape = self[var...
def get_dataset( self, dataset_id, ds_info, out=None, xslice=slice(None), yslice=slice(None) ): """Load data array and metadata from file on disk.""" var_path = ds_info.get("file_key", "{}".format(dataset_id.name)) dtype = ds_info.get("dtype", np.float32) cls = ds_info.pop("container", Dataset) ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_metadata(self, ds_id, ds_info): var_path = ds_info["file_key"] info = getattr(self[var_path], "attrs", {}) info.update(ds_info) info.update( { "shape": self.get_shape(ds_id, ds_info), "units": self[var_path + "/attr/UNIT"], "platform": self["/attr/Plat...
def get_metadata(self, m_key): raise NotImplementedError()
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, ds_id, ds_info): """Get output data and metadata of specified dataset""" var_path = ds_info["file_key"] fill_value = ds_info.get("fill_value", 65535) metadata = self.get_metadata(ds_id, ds_info) data = self[var_path] if ( ds_info.get("standard_name") == "longitude"...
def get_dataset(self, ds_id, ds_info, out=None): """Get output data and metadata of specified dataset""" var_path = ds_info["file_key"] fill_value = ds_info.get("fill_value", 65535) dtype = ds_info.get("dtype", np.float32) if out is None: shape = self.get_shape(ds_id, ds_info) out =...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info): """Get calibrated channel data.""" if self.mdrs is None: self._read_all(self.filename) if key.name in ["longitude", "latitude"]: lons, lats = self.get_full_lonlats() if key.name == "longitude": dataset = create_xarray(lons) else:...
def get_dataset(self, key, info): """Get calibrated channel data.""" if self.mdrs is None: self._read_all(self.filename) if key.name in ["longitude", "latitude"]: lons, lats = self.get_full_lonlats() # todo: make that datasets if key.name == "longitude": return ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, filename, filename_info, filetype_info): super(FCIFDHSIFileHandler, self).__init__(filename, filename_info, filetype_info) logger.debug("Reading: {}".format(filename)) logger.debug("Start: {}".format(self.start_time)) logger.debug("End: {}".format(self.end_time)) self.nc = h5py.F...
def __init__(self, filename, filename_info, filetype_info): super(FCIFDHSIFileHandler, self).__init__(filename, filename_info, filetype_info) logger.debug("Reading: {}".format(filename)) logger.debug("Start: {}".format(self.start_time)) logger.debug("End: {}".format(self.end_time)) self.nc = h5netc...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info=None): """Load a dataset""" if key in self.cache: return self.cache[key] logger.debug("Reading {}".format(key.name)) # Get the dataset # Get metadata for given dataset variable = self.nc["/data/{}/measured/effective_radiance".format(key.name)] # Conve...
def get_dataset(self, key, info=None): """Load a dataset""" if key in self.cache: return self.cache[key] logger.debug("Reading {}".format(key.name)) # Get the dataset # Get metadata for given dataset variable = self.nc["/data/{}/measured/effective_radiance".format(key.name)] ds = np...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calc_area_extent(self, key): """Calculate area extent for a dataset.""" # Calculate the area extent of the swath based on start line and column # information, total number of segments and channel resolution xyres = {500: 22272, 1000: 11136, 2000: 5568} chkres = xyres[key.resolution] # Get m...
def calc_area_extent(self, key): """Calculate area extent for a dataset.""" # Calculate the area extent of the swath based on start line and column # information, total number of segments and channel resolution xyres = {500: 22272, 1000: 11136, 2000: 5568} chkres = xyres[key.resolution] # Get m...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, data, key): """Data calibration.""" # logger.debug('Calibration: %s' % key.calibration) logger.warning("Calibration disabled!") if key.calibration == "brightness_temperature": pass # self._ir_calibrate(data, key) elif key.calibration == "reflectance...
def calibrate(self, data, key): """Data calibration.""" # logger.debug('Calibration: %s' % key.calibration) logger.warning("Calibration disabled!") if key.calibration == "brightness_temperature": pass # self._ir_calibrate(data, key) elif key.calibration == "reflectance...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def combine_info(self, all_infos): """Combine metadata for multiple datasets. When loading data from multiple files it can be non-trivial to combine things like start_time, end_time, start_orbit, end_orbit, etc. By default this method will produce a dictionary containing all values that were equal...
def combine_info(self, all_infos): """Combine metadata for multiple datasets. When loading data from multiple files it can be non-trivial to combine things like start_time, end_time, start_orbit, end_orbit, etc. By default this method will produce a dictionary containing all values that were equal...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info): if self.reader is None: with open(self.filename) as fdes: data = fdes.read(3) if data in ["CMS", "NSS", "UKM", "DSS"]: reader = GACKLMReader self.chn_dict = AVHRR3_CHANNEL_NAMES else: reader = GACPODReader ...
def get_dataset(self, key, info): if self.reader is None: with open(self.filename) as fdes: data = fdes.read(3) if data in ["CMS", "NSS", "UKM", "DSS"]: reader = GACKLMReader self.chn_dict = AVHRR3_CHANNEL_NAMES else: reader = GACPODReader ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_metadata(self, dataset_id, ds_info): var_name = ds_info.get("file_key", dataset_id.name) shape = self.get_shape(dataset_id, ds_info) info = getattr(self[var_name], "attrs", {}) info["shape"] = shape info.update(ds_info) u = info.get("units") if u in CF_UNITS: # CF compliance ...
def get_metadata(self, dataset_id, ds_info): var_name = ds_info.get("file_key", dataset_id.name) i = {} i.update(ds_info) for a in [ "standard_name", "units", "long_name", "flag_meanings", "flag_values", "flag_masks", ]: attr_path = var_name + ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, dataset_id, ds_info, xslice=slice(None), yslice=slice(None)): var_name = ds_info.get("file_key", dataset_id.name) # FUTURE: Metadata retrieval may be separate info = self.get_metadata(dataset_id, ds_info) data = self[var_name][yslice, xslice] fill = self[var_name + "/attr/_Fill...
def get_dataset( self, dataset_id, ds_info, out=None, xslice=slice(None), yslice=slice(None) ): var_name = ds_info.get("file_key", dataset_id.name) # FUTURE: Metadata retrieval may be separate i = self.get_metadata(dataset_id, ds_info) data = self[var_name][yslice, xslice] fill = self[var_name +...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _collect_attrs(self, name, attrs): for key, value in six.iteritems(attrs): value = np.squeeze(value) fc_key = "{}/attr/{}".format(name, key) try: self.file_content[fc_key] = np2str(value) except ValueError: self.file_content[fc_key] = value
def _collect_attrs(self, name, attrs): for key, value in six.iteritems(attrs): value = np.squeeze(value) self.file_content["{}/attr/{}".format(name, key)] = np2str(value)
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __getitem__(self, key): val = self.file_content[key] if isinstance(val, h5py.Dataset): # these datasets are closed and inaccessible when the file is closed, need to reopen dset = h5py.File(self.filename, "r")[key] dset = da.from_array(dset, chunks=CHUNK_SIZE) if dset.ndim > 1...
def __getitem__(self, key): val = self.file_content[key] if isinstance(val, h5py.Dataset): # these datasets are closed and inaccessible when the file is # closed, need to reopen return h5py.File(self.filename, "r")[key].value return val
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info, out=None, xslice=None, yslice=None): """Get the dataset designated by *key*.""" if key.name in [ "solar_zenith_angle", "solar_azimuth_angle", "satellite_zenith_angle", "satellite_azimuth_angle", ]: if key.name == "solar_zenith_angle": ...
def get_dataset(self, key, info, out=None, xslice=None, yslice=None): """Get the dataset designated by *key*.""" if key.name in [ "solar_zenith_angle", "solar_azimuth_angle", "satellite_zenith_angle", "satellite_azimuth_angle", ]: if key.name == "solar_zenith_angle": ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def load(self, keys, interpolate=True, raw=False): """Load the data.""" projectables = [] for key in keys: dataset = self.sd.select(key.name.capitalize()) fill_value = dataset.attributes()["_FillValue"] try: scale_factor = dataset.attributes()["scale_factor"] exce...
def load(self, keys, interpolate=True, raw=False): """Load the data.""" projectables = [] for key in keys: dataset = self.sd.select(key.name.capitalize()) fill_value = dataset.attributes()["_FillValue"] try: scale_factor = dataset.attributes()["scale_factor"] exce...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info): """Read data from file and return the corresponding projectables.""" datadict = { 1000: [ "EV_250_Aggr1km_RefSB", "EV_500_Aggr1km_RefSB", "EV_1KM_RefSB", "EV_1KM_Emissive", ], 500: ["EV_250_Aggr500_RefSB", ...
def get_dataset(self, key, info): """Read data from file and return the corresponding projectables.""" datadict = { 1000: [ "EV_250_Aggr1km_RefSB", "EV_500_Aggr1km_RefSB", "EV_1KM_RefSB", "EV_1KM_Emissive", ], 500: ["EV_250_Aggr500_RefSB", ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def dec10216(inbuf): """ /* * pack 4 10-bit words in 5 bytes into 4 16-bit words * * 0 1 2 3 4 5 * 01234567890123456789012345678901234567890 * 0 1 2 3 4 */ ip = &in_buffer[i]; op = &out_buffer[j]; op[0] = ip[...
def dec10216(inbuf): arr10 = inbuf.astype(np.uint16) arr16 = np.zeros((int(len(arr10) * 4 / 5),), dtype=np.uint16) arr10_len = int((len(arr16) * 5) / 4) arr10 = arr10[:arr10_len] # adjust size """ /* * pack 4 10-bit words in 5 bytes into 4 16-bit words * * 0 1 2 ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): """Load a dataset.""" # Read bands data = self.read_band(key, info) # Convert to xarray xdata = xr.DataArray(data, dims=["y", "x"]) # Mask invalid values return xdata
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): to_return = out is None if out is None: nlines = int(self.mda["number_of_lines"]) ncols = int(self.mda["number_of_columns"]) out = Dataset(np.ma.empty((nlines, ncols), dtype=np.float32)) self.read_ba...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def read_band(self, key, info): """Read the data""" # TODO slicing ! tic = datetime.now() if self.mda["number_of_bits_per_pixel"] == 16: dtype = ">u2" elif self.mda["number_of_bits_per_pixel"] in [8, 10]: dtype = np.uint8 shape = (int(np.ceil(self.mda["data_field_length"] / 8.0)...
def read_band(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): """Read the data""" # TODO slicing ! tic = datetime.now() with open(self.filename, "rb") as fp_: fp_.seek(self.mda["total_header_length"]) if self.mda["number_of_bits_per_pixel"] == 10: data = ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): """Get the data from the files.""" res = super(HRITGOMSFileHandler, self).get_dataset(key, info) res = self.calibrate(res, key.calibration) res.attrs["units"] = info["units"] res.attrs["standard_name"] = info["stan...
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): """Get the data from the files.""" res = super(HRITGOMSFileHandler, self).get_dataset(key, info, out, xslice, yslice) if res is not None: out = res self.calibrate(out, key.calibration) out.info["units"] = ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, data, calibration): """Calibrate the data.""" tic = datetime.now() if calibration == "counts": res = data if calibration in ["radiance", "brightness_temperature"]: res = self._calibrate(data) else: raise NotImplementedError("Don't know how to calibrate t...
def calibrate(self, data, calibration): """Calibrate the data.""" tic = datetime.now() if calibration == "counts": return if calibration == "radiance": self._vis_calibrate(data) elif calibration == "brightness_temperature": self._ir_calibrate(data) else: raise N...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, filename, filename_info, filetype_info, prologue, epilogue): """Initialize the reader.""" super(HRITMSGFileHandler, self).__init__( filename, filename_info, filetype_info, (msg_hdr_map, msg_variable_length_headers, msg_text_headers), ) self.prologue = p...
def __init__(self, filename, filename_info, filetype_info, prologue, epilogue): """Initialize the reader.""" super(HRITMSGFileHandler, self).__init__( filename, filename_info, filetype_info, (msg_hdr_map, msg_variable_length_headers, msg_text_headers), ) self.prologue = p...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_area_extent(self, size, offsets, factors, platform_height): """Get the area extent of the file.""" nlines, ncols = size h = platform_height loff, coff = offsets loff -= nlines offsets = loff, coff # count starts at 1 cols = 1 - 0.5 lines = 1 - 0.5 ll_x, ll_y = self.get_x...
def get_area_extent(self, size, offsets, factors, platform_height): """Get the area extent of the file.""" nlines, ncols = size h = platform_height loff, coff = offsets loff -= nlines offsets = loff, coff # count starts at 1 cols = 1 - 0.5 lines = 1 - 0.5 ll_x, ll_y = self.get_x...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info): res = super(HRITMSGFileHandler, self).get_dataset(key, info) res = self.calibrate(res, key.calibration) res.attrs["units"] = info["units"] res.attrs["wavelength"] = info["wavelength"] res.attrs["standard_name"] = info["standard_name"] res.attrs["platform_name"] ...
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): res = super(HRITMSGFileHandler, self).get_dataset(key, info, out, xslice, yslice) if res is not None: out = res self.calibrate(out, key.calibration) out.info["units"] = info["units"] out.info["wavelength"] ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, data, calibration): """Calibrate the data.""" tic = datetime.now() if calibration == "counts": res = data elif calibration in ["radiance", "reflectance", "brightness_temperature"]: res = self.convert_to_radiance(data) if calibration == "reflectance": res =...
def calibrate(self, data, calibration): """Calibrate the data.""" tic = datetime.now() if calibration == "counts": return if calibration in ["radiance", "reflectance", "brightness_temperature"]: self.convert_to_radiance(data) if calibration == "reflectance": self._vis_calib...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def convert_to_radiance(self, data): """Calibrate to radiance.""" coeffs = self.prologue["RadiometricProcessing"] coeffs = coeffs["Level1_5ImageCalibration"] gain = coeffs["Cal_Slope"][self.mda["spectral_channel_id"] - 1] offset = coeffs["Cal_Offset"][self.mda["spectral_channel_id"] - 1] return...
def convert_to_radiance(self, data): """Calibrate to radiance.""" coeffs = self.prologue["RadiometricProcessing"] coeffs = coeffs["Level1_5ImageCalibration"] gain = coeffs["Cal_Slope"][self.mda["spectral_channel_id"] - 1] offset = coeffs["Cal_Offset"][self.mda["spectral_channel_id"] - 1] data.d...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _vis_calibrate(self, data): """Visible channel calibration only.""" solar_irradiance = CALIB[self.platform_id][self.channel_name]["F"] return mb.vis_calibrate(data, solar_irradiance)
def _vis_calibrate(self, data): """Visible channel calibration only.""" solar_irradiance = CALIB[self.platform_id][self.channel_name]["F"] data.data[:] *= 100 / solar_irradiance
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _erads2bt(self, data): """computation based on effective radiance.""" cal_info = CALIB[self.platform_id][self.channel_name] alpha = cal_info["ALPHA"] beta = cal_info["BETA"] wavenumber = cal_info["VC"] return mb.erads2bt(data, wavenumber, alpha, beta)
def _erads2bt(self, data): """computation based on effective radiance.""" cal_info = CALIB[self.platform_id][self.channel_name] alpha = cal_info["ALPHA"] beta = cal_info["BETA"] self._tl15(data) data.data[:] -= beta data.data[:] /= alpha
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _srads2bt(self, data): """computation based on spectral radiance.""" coef_a, coef_b, coef_c = BTFIT[self.channel_name] wavenumber = CALIB[self.platform_id][self.channel_name]["VC"] return mb.srads2bt(data, wavenumber, coef_a, coef_b, coef_c)
def _srads2bt(self, data): """computation based on spectral radiance.""" coef_a, coef_b, coef_c = BTFIT[self.channel_name] self._tl15(data) data.data[:] = coef_a * data.data[:] ** 2 + coef_b * data.data[:] + coef_c
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _ir_calibrate(self, data): """IR calibration.""" cal_type = self.prologue["ImageDescription"]["Level1_5ImageProduction"][ "PlannedChanProcessing" ][self.mda["spectral_channel_id"]] if cal_type == 1: # spectral radiances return self._srads2bt(data) elif cal_type == 2: ...
def _ir_calibrate(self, data): """IR calibration.""" cal_type = self.prologue["ImageDescription"]["Level1_5ImageProduction"][ "PlannedChanProcessing" ][self.mda["spectral_channel_id"]] if cal_type == 1: # spectral radiances self._srads2bt(data) elif cal_type == 2: # ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, filename, filename_info, filetype_info): """Initialize the reader.""" self.filename = filename self.platform_name = None self.available_channels = {} self.channel_order_list = [] for item in CHANNEL_LIST: self.available_channels[item] = False self._get_header() ...
def __init__(self, filename, filename_info, filetype_info): """Initialize the reader.""" self.filename = filename self.platform_name = None self.available_channels = {} self.channel_order_list = [] for item in CHANNEL_LIST: self.available_channels[item] = False self._get_header() ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _get_header(self): """Read the header info""" hdrrec = Msg15NativeHeaderRecord().get() hd_dt = np.dtype(hdrrec) hd_dt = hd_dt.newbyteorder(">") self.header = np.fromfile(self.filename, dtype=hd_dt, count=1) # Set the list of available channels: chlist_str = self.header["15_SECONDARY_PR...
def _get_header(self): """Read the header info""" hdrrec = Msg15NativeHeaderRecord().get() hd_dt = np.dtype(hdrrec) hd_dt = hd_dt.newbyteorder(">") self.header = np.fromfile(self.filename, dtype=hd_dt, count=1) # Set the list of available channels: chlist_str = self.header["15_SECONDARY_PR...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, key, info, xslice=slice(None), yslice=slice(None)): if key.name not in self.channel_order_list: raise KeyError("Channel % s not available in the file" % key.name) elif key.name not in ["HRV"]: ch_idn = self.channel_order_list.index(key.name) data = dec10216(self.mem...
def get_dataset(self, key, info, out=None, xslice=slice(None), yslice=slice(None)): if key.name not in self.channel_order_list: raise KeyError("Channel % s not available in the file" % key.name) elif key.name not in ["HRV"]: ch_idn = self.channel_order_list.index(key.name) data = dec1021...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def calibrate(self, data, key): """Calibrate the data.""" tic = datetime.now() calibration = key.calibration if calibration == "counts": return if calibration in ["radiance", "reflectance", "brightness_temperature"]: res = self.convert_to_radiance(data, key.name) if calibration...
def calibrate(self, data, key): """Calibrate the data.""" tic = datetime.now() calibration = key.calibration if calibration == "counts": return if calibration in ["radiance", "reflectance", "brightness_temperature"]: self.convert_to_radiance(data, key.name) if calibration == "r...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def convert_to_radiance(self, data, key_name): """Calibrate to radiance.""" coeffs = self.header["15_DATA_HEADER"]["RadiometricProcessing"][ "Level15ImageCalibration" ] channel_index = self.channel_order_list.index(key_name) gain = coeffs["CalSlope"][0][channel_index] offset = coeffs[...
def convert_to_radiance(self, data, key_name): """Calibrate to radiance.""" coeffs = self.header["15_DATA_HEADER"]["RadiometricProcessing"][ "Level15ImageCalibration" ] channel_index = self.channel_order_list.index(key_name) gain = coeffs["CalSlope"][0][channel_index] offset = coeffs[...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _vis_calibrate(self, data, key_name): """Visible channel calibration only.""" solar_irradiance = CALIB[self.platform_id][key_name]["F"] return mb.vis_calibrate(data, solar_irradiance)
def _vis_calibrate(self, data, key_name): """Visible channel calibration only.""" solar_irradiance = CALIB[self.platform_id][key_name]["F"] data.data[:] *= 100 / solar_irradiance
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _erads2bt(self, data, key_name): """computation based on effective radiance.""" cal_info = CALIB[self.platform_id][key_name] alpha = cal_info["ALPHA"] beta = cal_info["BETA"] wavenumber = CALIB[self.platform_id][key_name]["VC"] return mb.erads2bt(data, wavenumber, alpha, beta)
def _erads2bt(self, data, key_name): """computation based on effective radiance.""" cal_info = CALIB[self.platform_id][key_name] alpha = cal_info["ALPHA"] beta = cal_info["BETA"] self._tl15(data, key_name) data.data[:] -= beta data.data[:] /= alpha
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _srads2bt(self, data, key_name): """computation based on spectral radiance.""" coef_a, coef_b, coef_c = BTFIT[key_name] wavenumber = CALIB[self.platform_id][key_name]["VC"] return mb.srads2bt(data, wavenumber, coef_a, coef_b, coef_c)
def _srads2bt(self, data, key_name): """computation based on spectral radiance.""" coef_a, coef_b, coef_c = BTFIT[key_name] self._tl15(data, key_name) data.data[:] = coef_a * data.data[:] ** 2 + coef_b * data.data[:] + coef_c
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def _ir_calibrate(self, data, key_name): """IR calibration.""" channel_index = self.channel_order_list.index(key_name) cal_type = self.header["15_DATA_HEADER"]["ImageDescription"][ "Level15ImageProduction" ]["PlannedChanProcessing"][0][channel_index] if cal_type == 1: # spectral r...
def _ir_calibrate(self, data, key_name): """IR calibration.""" channel_index = self.channel_order_list.index(key_name) cal_type = self.header["15_DATA_HEADER"]["ImageDescription"][ "Level15ImageProduction" ]["PlannedChanProcessing"][0][channel_index] if cal_type == 1: # spectral r...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def __init__(self, filename, filename_info, filetype_info): """Init method.""" super(NcNWCSAF, self).__init__(filename, filename_info, filetype_info) self.nc = xr.open_dataset( filename, decode_cf=True, mask_and_scale=False, engine="h5netcdf", chunks=1000 ) self.nc = self.nc.rename({"nx": "...
def __init__(self, filename, filename_info, filetype_info): """Init method""" super(NcNWCSAF, self).__init__(filename, filename_info, filetype_info) self.nc = h5netcdf.File(filename, "r") self.pps = False try: # MSG: sat_id = self.nc.attrs["satellite_identifier"] self.platfo...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_dataset(self, dsid, info): """Load a dataset.""" logger.debug("Reading %s.", dsid.name) variable = self.nc[dsid.name] variable = remove_empties(variable) if "scale_factor" in variable.attrs or "add_offset" in variable.attrs: scale = variable.attrs.get("scale_factor", 1) off...
def get_dataset(self, dsid, info, out=None): """Load a dataset.""" logger.debug("Reading %s.", dsid.name) variable = self.nc[dsid.name] info = {"platform_name": self.platform_name, "sensor": self.sensor} try: values = np.ma.masked_equal( variable[:], variable.attrs["_FillValue...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def get_area_def(self, dsid): """Get the area definition of the datasets in the file. Only applicable for MSG products! """ if self.pps: # PPS: raise NotImplementedError if dsid.name.endswith("_pal"): raise NotImplementedError try: proj_str = self.nc.attrs["gda...
def get_area_def(self, dsid): """Get the area definition of the datasets in the file. Only applicable for MSG products!""" if self.pps: # PPS: raise NotImplementedError if dsid.name.endswith("_pal"): raise NotImplementedError proj_str = self.nc.attrs["gdal_projection"] + " ...
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError
def start_time(self): """Return the start time of the object.""" try: # MSG: try: return datetime.strptime( self.nc.attrs["time_coverage_start"], "%Y-%m-%dT%H:%M:%SZ" ) except TypeError: return datetime.strptime( self.nc...
def start_time(self): try: # MSG: return datetime.strptime( self.nc.attrs["time_coverage_start"], "%Y-%m-%dT%H:%M:%SZ" ) except ValueError: # PPS: return datetime.strptime( self.nc.attrs["time_coverage_start"], "%Y%m%dT%H%M%S%fZ" )
https://github.com/pytroll/satpy/issues/123
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save. [INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save. --------------------------------------------------------------...
AttributeError