def test_load_singlenc2xarray_by_pixels(self): """ Tests loading of an xarray array from a multidimensional NetCDF file by a bounding box. """ dc = EODataCube(filepaths=[self.nc_filepath], smart_filename_class=SgrtFilename, dimensions=['time']) data = dc.load_by_geom(self.bbox, band='SIG0', dtype='xarray', origin='c') assert self.ref_xr_ds_area.equals(data.rename({'SIG0': '1'})) dc.close()
def test_load_singlenc2xarray_by_coord(self): """ Tests loading of an xarray array from a multidimensional NetCDF file by geographic coordinates. """ dc = EODataCube(filepaths=[self.nc_filepath], smart_filename_class=SgrtFilename, dimensions=['time']) data = dc.load_by_coords(self.lon, self.lat, sref=self.sref, band='SIG0', dtype='xarray', origin='c') assert self.ref_xr_ds.equals(data.rename({'SIG0': '1'})) dc.close()