def describe(self, flush=True): """Describe an instance by printing to stdout""" dsc = XTGDescription() dsc.title("Description of {} instance".format(self.__class__.__name__)) dsc.txt("Object ID", id(self)) dsc.txt("xname, yname, zname", self._xname, self._yname, self._zname) if flush: dsc.flush() return None return dsc.astext()
def describe(self, flush=True): """Describe an instance by printing to stdout or return""" dsc = XTGDescription() dsc.title("Description of Cube instance") dsc.txt("Object ID", id(self)) dsc.txt("File source", self._filesrc) dsc.txt("Shape: NCOL, NROW, NLAY", self.ncol, self.nrow, self.nlay) dsc.txt("Origins XORI, YORI, ZORI", self.xori, self.yori, self.zori) dsc.txt("Increments XINC YINC ZINC", self.xinc, self.yinc, self.zinc) dsc.txt("Rotation (anti-clock from X)", self.rotation) dsc.txt("YFLIP flag", self.yflip) np.set_printoptions(threshold=16) dsc.txt("Inlines vector", self._ilines) dsc.txt("Xlines vector", self._xlines) dsc.txt("Time or depth slices vector", self.zslices) dsc.txt("Values", self._values.reshape(-1), self._values.dtype) np.set_printoptions(threshold=1000) dsc.txt( "Values, mean, stdev, minimum, maximum", self.values.mean(), self.values.std(), self.values.min(), self.values.max(), ) dsc.txt("Trace ID codes", self._traceidcodes.reshape(-1)) msize = float(self.values.size * 4) / (1024 * 1024 * 1024) dsc.txt("Minimum memory usage of array (GB)", msize) if flush: dsc.flush() return None return dsc.astext()
def describe(self, flush=True): """Describe an instance by printing to stdout""" dsc = XTGDescription() dsc.title("Description of GridProperties instance") dsc.txt("Object ID", id(self)) dsc.txt("Shape: NCOL, NROW, NLAY", self.ncol, self.nrow, self.nlay) dsc.txt("Attached grid props objects (names)", self._names) if flush: dsc.flush() return None return dsc.astext()
def describe(self, details=False, flush=True): """Describe an instance by printing to stdout""" logger.info("Print a description...") if details: geom = self.get_geometrics(cellcenter=True, return_dict=True) prp1 = [] for prp in ("xmin", "xmax", "ymin", "ymax", "zmin", "zmax"): prp1.append("{:10.3f}".format(geom[prp])) prp2 = [] for prp in ("avg_dx", "avg_dy", "avg_dz", "avg_rotation"): prp2.append("{:7.4f}".format(geom[prp])) geox = self.get_geometrics(cellcenter=False, allcells=True, return_dict=True) prp3 = [] for prp in ("xmin", "xmax", "ymin", "ymax", "zmin", "zmax"): prp3.append("{:10.3f}".format(geox[prp])) prp4 = [] for prp in ("avg_dx", "avg_dy", "avg_dz", "avg_rotation"): prp4.append("{:7.4f}".format(geox[prp])) dsc = XTGDescription() dsc.title("Description of Grid instance") dsc.txt("Object ID", id(self)) if details: dsc.txt("SWIG ID to coordinates pointer", self._p_coord_v) dsc.txt("SWIG ID to zcorn pointer", self._p_zcorn_v) dsc.txt("SWIG ID to actnum pointer", self._p_actnum_v) dsc.txt("File source", self._filesrc) dsc.txt("Shape: NCOL, NROW, NLAY", self.ncol, self.nrow, self.nlay) dsc.txt("Number of active cells", self.nactive) if details: dsc.txt("For active cells, using cell centers:") dsc.txt("Xmin, Xmax, Ymin, Ymax, Zmin, Zmax:", *prp1) dsc.txt("Avg DX, Avg DY, Avg DZ, Avg rotation:", *prp2) dsc.txt("For all cells, using cell corners:") dsc.txt("Xmin, Xmax, Ymin, Ymax, Zmin, Zmax:", *prp3) dsc.txt("Avg DX, Avg DY, Avg DZ, Avg rotation:", *prp4) dsc.txt("Attached grid props objects (names)", self.propnames) if details: dsc.txt("Attached grid props objects (id)", self.props) if self.subgrids: dsc.txt("Number of subgrids", len(list(self.subgrids.keys()))) else: dsc.txt("Number of subgrids", "No subgrids") if details: dsc.txt("Subgrids details", json.dumps(self.get_subgrids())) dsc.txt("Subgrids with values array", self.subgrids) if flush: dsc.flush() return None return dsc.astext()