From 61b3068fb2f6eb63350c8401a4bb1d74ec645f03 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 21 Jul 2020 09:25:14 +0200 Subject: [PATCH 1/3] Make connectivity always int (not int32) --- conda_package/mpas_tools/viz/paraview_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_package/mpas_tools/viz/paraview_extractor.py b/conda_package/mpas_tools/viz/paraview_extractor.py index 12fe73cf4..dde5b9c60 100644 --- a/conda_package/mpas_tools/viz/paraview_extractor.py +++ b/conda_package/mpas_tools/viz/paraview_extractor.py @@ -1565,7 +1565,7 @@ def build_cell_geom_lists(nc_file, output_32bit, lonlat): # {{{ nc_file.x_period, nc_file.y_period) - connectivity = verticesOnCell[validVertices] + connectivity = numpy.array(verticesOnCell[validVertices], int) offsets = numpy.cumsum(nEdgesOnCell, dtype=int) valid_mask = numpy.ones(nCells, bool) From 117002eb7e80ec26fd00bf952dcf012c13e03dba Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 21 Jul 2020 09:26:03 +0200 Subject: [PATCH 2/3] Fix name of "active" scalar --- conda_package/mpas_tools/viz/paraview_extractor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conda_package/mpas_tools/viz/paraview_extractor.py b/conda_package/mpas_tools/viz/paraview_extractor.py index dde5b9c60..b05dd7fd2 100644 --- a/conda_package/mpas_tools/viz/paraview_extractor.py +++ b/conda_package/mpas_tools/viz/paraview_extractor.py @@ -1328,8 +1328,7 @@ def write_vtp_header(path, prefix, active_var_index, var_indices, if cellData: vtkFile.openData(str("Cell"), - scalars=[str(var) for var in - variable_list[active_var_index]]) + scalars=variable_list[active_var_index]) for iVar in var_indices: var_name = variable_list[iVar] (out_var_names, dim_list) = \ @@ -1339,8 +1338,7 @@ def write_vtp_header(path, prefix, active_var_index, var_indices, vtkFile.closeData(str("Cell")) if pointData: vtkFile.openData(str("Point"), - scalars=[str(var) for var in - variable_list[active_var_index]]) + scalars=variable_list[active_var_index]) for iVar in var_indices: var_name = variable_list[iVar] (out_var_names, dim_list) = \ From b684fdc7356fc9d31609ee666f4b08beef3e9200 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 21 Jul 2020 11:04:42 +0200 Subject: [PATCH 3/3] Fix date annotation macro for paraview --- visualization/paraview_vtk_field_extractor/annotate_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualization/paraview_vtk_field_extractor/annotate_date.py b/visualization/paraview_vtk_field_extractor/annotate_date.py index 4935127dc..71f33c552 100644 --- a/visualization/paraview_vtk_field_extractor/annotate_date.py +++ b/visualization/paraview_vtk_field_extractor/annotate_date.py @@ -53,7 +53,7 @@ # create a new 'Python Annotation' pythonAnnotation1 = paraview.simple.PythonAnnotation(Input=programmableFilter1) -pythonAnnotation1.ArrayAssociation = 'Row Data' +pythonAnnotation1.ArrayAssociation = 'Field Data' pythonAnnotation1.Expression = \ '"{}".format(input.RowData["datetime"].GetValue(0))'