def _oblique_pixelize(self, data_source, field, bounds, size, antialias): from yt.frontends.ytdata.data_structures import YTSpatialPlotDataset indices = np.argsort(data_source["pdx"])[::-1].astype(np.int_) buff = np.zeros((size[1], size[0]), dtype="f8") ftype = "index" if isinstance(data_source.ds, YTSpatialPlotDataset): ftype = "gas" pixelize_off_axis_cartesian( buff, data_source[ftype, "x"], data_source[ftype, "y"], data_source[ftype, "z"], data_source["px"], data_source["py"], data_source["pdx"], data_source["pdy"], data_source["pdz"], data_source.center, data_source._inv_mat, indices, data_source[field], bounds, ) return buff
def _oblique_pixelize(self, data_source, field, bounds, size, antialias): indices = np.argsort(data_source['pdx'])[::-1].astype(np.int_) buff = np.zeros((size[1], size[0]), dtype="f8") pixelize_off_axis_cartesian(buff, data_source['x'], data_source['y'], data_source['z'], data_source['px'], data_source['py'], data_source['pdx'], data_source['pdy'], data_source['pdz'], data_source.center, data_source._inv_mat, indices, data_source[field], bounds) return buff
def _oblique_pixelize(self, data_source, field, bounds, size, antialias): indices = np.argsort(data_source['dx'])[::-1] buff = pixelize_off_axis_cartesian( data_source['x'], data_source['y'], data_source['z'], data_source['px'], data_source['py'], data_source['pdx'], data_source['pdy'], data_source['pdz'], data_source.center, data_source._inv_mat, indices, data_source[field], size[0], size[1], bounds).transpose() return buff
def __getitem__(self, item): if item in self.data: return self.data[item] indices = np.argsort(self.data_source['dx'])[::-1] bounds = [] for b in self.bounds: if hasattr(b, "in_units"): b = float(b.in_units("code_length")) bounds.append(b) buff = pixelize_off_axis_cartesian( self.data_source['x'], self.data_source['y'], self.data_source['z'], self.data_source['px'], self.data_source['py'], self.data_source['pdx'], self.data_source['pdy'], self.data_source['pdz'], self.data_source.center, self.data_source._inv_mat, indices, self.data_source[item], self.buff_size[0], self.buff_size[1], bounds).transpose() ia = ImageArray(buff, input_units=self.data_source[item].units, info=self._get_info(item)) self[item] = ia return ia