def convert_thickness_error_files(self, thickness_error_profile_data_files): self.crl_error_profiles = [] for thickness_error_file in thickness_error_profile_data_files: xx, yy, zz = OU.read_surface_file(thickness_error_file) xx /= self.workspace_units_to_m yy /= self.workspace_units_to_m zz /= self.workspace_units_to_m filename, _ = os.path.splitext(os.path.basename(thickness_error_file)) thickness_error_file = filename + "_hybrid.h5" OU.write_surface_file(zz, xx, yy, thickness_error_file) self.crl_error_profiles.append(thickness_error_file)
def render_surface(self): try: self.surface_file_name = congruence.checkDir( self.surface_file_name) #### LENGTH xx, yy, zz = OU.read_surface_file(self.surface_file_name) self.xx = xx self.yy = yy self.zz = zz self.axis.clear() x_to_plot, y_to_plot = numpy.meshgrid(self.xx, self.yy) self.axis.plot_surface(x_to_plot, y_to_plot, zz, rstride=1, cstride=1, cmap=cm.autumn, linewidth=0.5, antialiased=True) self.axis.set_xlabel("X [m]") self.axis.set_ylabel("Y [m]") self.axis.set_zlabel("Z [m]") self.axis.mouse_init() self.figure_canvas.draw() self.send( "Surface Data", OasysSurfaceData(xx=self.xx, yy=self.yy, zz=self.zz, surface_data_file=self.surface_file_name)) except Exception as exception: QMessageBox.critical(self, "Error", exception.args[0], QMessageBox.Ok) if self.IS_DEVELOP: raise exception
def read_surface(self): try: self.surface_file_name = congruence.checkDir( self.surface_file_name) xx, yy, zz = OU.read_surface_file(self.surface_file_name) zz = zz if self.negate == 0 else -1.0 * zz self.xx = xx self.yy = yy self.zz = zz self.send( "Surface Data", OasysSurfaceData(xx=self.xx, yy=self.yy, zz=self.zz, surface_data_file=self.surface_file_name)) except Exception as exception: QMessageBox.critical(self, "Error", exception.args[0], QMessageBox.Ok) if self.IS_DEVELOP: raise exception
def h5_readsurface(filename): x_coords, y_coords, z_values = OU.read_surface_file(filename) return ScaledMatrix(x_coords, y_coords, z_values.T)