ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkUnstructuredPOPReader Class Reference

read NetCDF files More...

#include <vtkUnstructuredPOPReader.h>

Inherits vtkUnstructuredGridAlgorithm.

Public Types

typedef vtkUnstructuredGridAlgorithm Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetFileName (const char *)
 The NetCDF file to open. More...
 
virtual char * GetFileName ()
 The NetCDF file to open. More...
 
virtual void SetStride (int, int, int)
 Enable subsampling in i,j and k dimensions for the topologically structured input data. More...
 
virtual void SetStride (int [3])
 Enable subsampling in i,j and k dimensions for the topologically structured input data. More...
 
virtual int * GetStride ()
 Enable subsampling in i,j and k dimensions for the topologically structured input data. More...
 
virtual void GetStride (int &, int &, int &)
 Enable subsampling in i,j and k dimensions for the topologically structured input data. More...
 
virtual void GetStride (int [3])
 Enable subsampling in i,j and k dimensions for the topologically structured input data. More...
 
virtual void SetVOI (int, int, int, int, int, int)
 Set the VOI of for the topologically structured input data. More...
 
virtual void SetVOI (int [6])
 Set the VOI of for the topologically structured input data. More...
 
virtual int * GetVOI ()
 Set the VOI of for the topologically structured input data. More...
 
virtual void GetVOI (int &, int &, int &, int &, int &, int &)
 Set the VOI of for the topologically structured input data. More...
 
virtual void GetVOI (int [6])
 Set the VOI of for the topologically structured input data. More...
 
virtual int GetNumberOfVariableArrays ()
 Variable array selection. More...
 
virtual const char * GetVariableArrayName (int idx)
 Variable array selection. More...
 
virtual int GetVariableArrayStatus (const char *name)
 Variable array selection. More...
 
virtual void SetVariableArrayStatus (const char *name, int status)
 Variable array selection. More...
 
virtual void SetRadius (double)
 Set the outer radius of the Earth. More...
 
virtual double GetRadius ()
 Set the outer radius of the Earth. More...
 
virtual int GetVectorGrid ()
 Determine whether or not the input data is being interpolated at the U/vector points or T/scalar points. More...
 
virtual void SetVerticalVelocity (bool)
 Specify whether or not to compute the vertical velocity component from the horizontal velocity components. More...
 
virtual bool GetVerticalVelocity ()
 Specify whether or not to compute the vertical velocity component from the horizontal velocity components. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkUnstructuredPOPReaderSafeDownCast (vtkObject *o)
 
static vtkUnstructuredPOPReaderNew ()
 

Protected Member Functions

 vtkUnstructuredPOPReader ()
 
 ~vtkUnstructuredPOPReader ()
 
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
 
bool Transform (vtkUnstructuredGrid *grid, size_t *start, size_t *count, int *wholeExtent, int *subExtent, int numberOfGhostLevels, int wrapped, int piece, int numberOfPieces)
 Transform the grid from a topologically structured grid to a sphere shaped grid and do any vector transformations on field data that is needed. More...
 
int ProcessGrid (vtkUnstructuredGrid *grid, int piece, int numberOfPieces, int numberOfGhostLevels)
 Given the meta data about the grid partitioning, read in the data from the file and create the unstructured grid. More...
 
bool ReadMetaData (int wholeExtent[6])
 Reads the meta data from the NetCDF file for information like what variables exist and the dimensions of the grids and variables. More...
 
int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
 
void LoadPointData (vtkUnstructuredGrid *grid, int netCDFFD, int varidp, size_t *start, size_t *count, ptrdiff_t *rStride, const char *arrayName)
 Adds a point data field given by varidp in the NetCDF file to the grid's point data. More...
 
void ComputeVerticalVelocity (vtkUnstructuredGrid *grid, int *wholeExtent, int *subExtent, int numberOfGhostLevels, int latlonFileId)
 Compute the vertical velocity component and add it into the velocity field. More...
 
void CommunicateParallelVerticalVelocity (int *wholeExtent, int *subExtent, int numberOfGhostLevels, VTKPointIterator &pointIterator, double *w)
 If the reader is being run in parallel, do the necessary communication to finish the vertical velocity integration on each process. More...
 
int GetPointOwnerPiece (int iIndex, int jIndex, int kKindex, int numberOfPieces, int numberOfGhostLevels, int *wholeExtent)
 Given ijk indices with respect to WholeExtent, return the process that is considered owning this point. More...
 
void GetPiecesNeedingPoint (int iIndex, int jIndex, int kKindex, int numberOfPieces, int numberOfGhostLevels, int *wholeExtent, vtkIdList *pieceIds)
 Given ijk indices, fill pieceIds with the pieces which contain need this point for computing the vertical velocity. More...
 
bool GetExtentInformation (int piece, int numberOfPieces, int numberOfGhostLevels, int *wholeExtent, int *subExtent)
 Given piece, numberOfPieces, numberOfGhostLevels, and wholeExtent, this method fills in subExtent. More...
 
bool BuildGhostInformation (vtkUnstructuredGrid *grid, int numberOfGhostLevels, int *wholeExtent, int *subExtent, int wrapped, int piece, int numberOfPieces)
 Build up the requested ghost information. More...
 

Static Protected Member Functions

static void SelectionModifiedCallback (vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
 
static void EventCallback (vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
 

Protected Attributes

vtkCallbackCommand * SelectionObserver
 
char * FileName
 The name of the file to be opened. More...
 
int Stride [3]
 
int NCDFFD
 The NetCDF file descriptor. More...
 
double Radius
 The radius of the sphere to be outputted in meters. More...
 
int VOI [6]
 
int VectorGrid
 Specify whether the grid points are at the vector field (U_LAT and U_LON) locations or the scalar field (T_LAT and T_LON) locations or unset. More...
 
bool VerticalVelocity
 If it is a vector grid (i.e. More...
 
bool SubsettingXMin
 State variables so that we know whether or not we are only reading in part of the grid. More...
 
bool SubsettingXMax
 State variables so that we know whether or not we are only reading in part of the grid. More...
 
bool ReducedHeightResolution
 State variables so that we know whether or not we are only reading in part of the grid. More...
 
char * OpenedFileName
 If a file is opened, the file name of the opened file. More...
 
virtual void SetOpenedFileName (const char *)
 If a file is opened, the file name of the opened file. More...
 

Detailed Description

read NetCDF files

vtkUnstructuredPOPReader reads NetCDF POP files into a spherical shaped grid. The input file has topologically structured data. The striding and VOI are done with respect to the topologically structured ordering. Additionally, the z coordinates of the output grid are negated so that the first slice/plane has the highest z-value and the last slice/plane has the lowest z-value. Note that depth_t is used for the z location of the points. For VOI and striding, striding is done first and then the VOI is done. For example, if stride was [1, 2, 3] for a [3600, 2400, 42] grid then the wholeExtent would be [0, 3600, 0, 1200, 0, 14] and then a VOI of [10, 300, 0, 1400, 2 8] would result in a whole extent of [10, 300, 0, 1200, 2, 8] with the first point being [10, 0, 6] in the [3600, 2400, 42] original grid. The reader also requires a GRID.nc file in the same directory as the main file. This is used to map from tripolar logical coordinates to lat-lon coordinates.

Definition at line 49 of file vtkUnstructuredPOPReader.h.

Member Typedef Documentation

◆ Superclass

typedef vtkUnstructuredGridAlgorithm vtkUnstructuredPOPReader::Superclass

Definition at line 53 of file vtkUnstructuredPOPReader.h.

Constructor & Destructor Documentation

◆ vtkUnstructuredPOPReader()

vtkUnstructuredPOPReader::vtkUnstructuredPOPReader ( )
protected

◆ ~vtkUnstructuredPOPReader()

vtkUnstructuredPOPReader::~vtkUnstructuredPOPReader ( )
protected

Member Function Documentation

◆ GetClassName()

virtual const char* vtkUnstructuredPOPReader::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkUnstructuredPOPReader::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkUnstructuredPOPReader::IsA ( const char *  type)
virtual

◆ SafeDownCast()

static vtkUnstructuredPOPReader* vtkUnstructuredPOPReader::SafeDownCast ( vtkObject *  o)
static

◆ New()

static vtkUnstructuredPOPReader* vtkUnstructuredPOPReader::New ( )
static

◆ PrintSelf()

void vtkUnstructuredPOPReader::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

◆ SetFileName()

virtual void vtkUnstructuredPOPReader::SetFileName ( const char *  )
virtual

The NetCDF file to open.

◆ GetFileName()

virtual char* vtkUnstructuredPOPReader::GetFileName ( )
virtual

The NetCDF file to open.

◆ SetStride() [1/2]

virtual void vtkUnstructuredPOPReader::SetStride ( int  ,
int  ,
int   
)
virtual

Enable subsampling in i,j and k dimensions for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ SetStride() [2/2]

virtual void vtkUnstructuredPOPReader::SetStride ( int  [3])
virtual

Enable subsampling in i,j and k dimensions for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetStride() [1/3]

virtual int* vtkUnstructuredPOPReader::GetStride ( )
virtual

Enable subsampling in i,j and k dimensions for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetStride() [2/3]

virtual void vtkUnstructuredPOPReader::GetStride ( int &  ,
int &  ,
int &   
)
virtual

Enable subsampling in i,j and k dimensions for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetStride() [3/3]

virtual void vtkUnstructuredPOPReader::GetStride ( int  [3])
virtual

Enable subsampling in i,j and k dimensions for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ SetVOI() [1/2]

virtual void vtkUnstructuredPOPReader::SetVOI ( int  ,
int  ,
int  ,
int  ,
int  ,
int   
)
virtual

Set the VOI of for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ SetVOI() [2/2]

virtual void vtkUnstructuredPOPReader::SetVOI ( int  [6])
virtual

Set the VOI of for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetVOI() [1/3]

virtual int* vtkUnstructuredPOPReader::GetVOI ( )
virtual

Set the VOI of for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetVOI() [2/3]

virtual void vtkUnstructuredPOPReader::GetVOI ( int &  ,
int &  ,
int &  ,
int &  ,
int &  ,
int &   
)
virtual

Set the VOI of for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetVOI() [3/3]

virtual void vtkUnstructuredPOPReader::GetVOI ( int  [6])
virtual

Set the VOI of for the topologically structured input data.

Note that if number of points in the z-direction are reduced that the vertical velocity will not be computed.

◆ GetNumberOfVariableArrays()

virtual int vtkUnstructuredPOPReader::GetNumberOfVariableArrays ( )
virtual

Variable array selection.

◆ GetVariableArrayName()

virtual const char* vtkUnstructuredPOPReader::GetVariableArrayName ( int  idx)
virtual

Variable array selection.

◆ GetVariableArrayStatus()

virtual int vtkUnstructuredPOPReader::GetVariableArrayStatus ( const char *  name)
virtual

Variable array selection.

◆ SetVariableArrayStatus()

virtual void vtkUnstructuredPOPReader::SetVariableArrayStatus ( const char *  name,
int  status 
)
virtual

Variable array selection.

◆ SetRadius()

virtual void vtkUnstructuredPOPReader::SetRadius ( double  )
virtual

Set the outer radius of the Earth.

By default it is 6371000 which assumes the length is in meters.

◆ GetRadius()

virtual double vtkUnstructuredPOPReader::GetRadius ( )
virtual

Set the outer radius of the Earth.

By default it is 6371000 which assumes the length is in meters.

◆ GetVectorGrid()

virtual int vtkUnstructuredPOPReader::GetVectorGrid ( )
virtual

Determine whether or not the input data is being interpolated at the U/vector points or T/scalar points.

0 means unset, 2 means vector field, and 1 means scalar field.

◆ SetVerticalVelocity()

virtual void vtkUnstructuredPOPReader::SetVerticalVelocity ( bool  )
virtual

Specify whether or not to compute the vertical velocity component from the horizontal velocity components.

Default is false which signifies do not compute.

◆ GetVerticalVelocity()

virtual bool vtkUnstructuredPOPReader::GetVerticalVelocity ( )
virtual

Specify whether or not to compute the vertical velocity component from the horizontal velocity components.

Default is false which signifies do not compute.

◆ RequestData()

int vtkUnstructuredPOPReader::RequestData ( vtkInformation *  ,
vtkInformationVector **  ,
vtkInformationVector *   
)
protected

◆ SelectionModifiedCallback()

static void vtkUnstructuredPOPReader::SelectionModifiedCallback ( vtkObject *  caller,
unsigned long  eid,
void *  clientdata,
void *  calldata 
)
staticprotected

◆ EventCallback()

static void vtkUnstructuredPOPReader::EventCallback ( vtkObject *  caller,
unsigned long  eid,
void *  clientdata,
void *  calldata 
)
staticprotected

◆ SetOpenedFileName()

virtual void vtkUnstructuredPOPReader::SetOpenedFileName ( const char *  )
protectedvirtual

If a file is opened, the file name of the opened file.

◆ Transform()

bool vtkUnstructuredPOPReader::Transform ( vtkUnstructuredGrid *  grid,
size_t *  start,
size_t *  count,
int *  wholeExtent,
int *  subExtent,
int  numberOfGhostLevels,
int  wrapped,
int  piece,
int  numberOfPieces 
)
protected

Transform the grid from a topologically structured grid to a sphere shaped grid and do any vector transformations on field data that is needed.

◆ ProcessGrid()

int vtkUnstructuredPOPReader::ProcessGrid ( vtkUnstructuredGrid *  grid,
int  piece,
int  numberOfPieces,
int  numberOfGhostLevels 
)
protected

Given the meta data about the grid partitioning, read in the data from the file and create the unstructured grid.

◆ ReadMetaData()

bool vtkUnstructuredPOPReader::ReadMetaData ( int  wholeExtent[6])
protected

Reads the meta data from the NetCDF file for information like what variables exist and the dimensions of the grids and variables.

Returns true for success. Also fills out wholeExtent.

◆ RequestInformation()

int vtkUnstructuredPOPReader::RequestInformation ( vtkInformation *  request,
vtkInformationVector **  inputVector,
vtkInformationVector *  outputVector 
)
protected

◆ LoadPointData()

void vtkUnstructuredPOPReader::LoadPointData ( vtkUnstructuredGrid *  grid,
int  netCDFFD,
int  varidp,
size_t *  start,
size_t *  count,
ptrdiff_t *  rStride,
const char *  arrayName 
)
protected

Adds a point data field given by varidp in the NetCDF file to the grid's point data.

If the units is "centimeter/s" it scales the value by 1/100 (i.e. meter/s).

◆ ComputeVerticalVelocity()

void vtkUnstructuredPOPReader::ComputeVerticalVelocity ( vtkUnstructuredGrid *  grid,
int *  wholeExtent,
int *  subExtent,
int  numberOfGhostLevels,
int  latlonFileId 
)
protected

Compute the vertical velocity component and add it into the velocity field.

◆ CommunicateParallelVerticalVelocity()

void vtkUnstructuredPOPReader::CommunicateParallelVerticalVelocity ( int *  wholeExtent,
int *  subExtent,
int  numberOfGhostLevels,
VTKPointIterator &  pointIterator,
double *  w 
)
protected

If the reader is being run in parallel, do the necessary communication to finish the vertical velocity integration on each process.

◆ GetPointOwnerPiece()

int vtkUnstructuredPOPReader::GetPointOwnerPiece ( int  iIndex,
int  jIndex,
int  kKindex,
int  numberOfPieces,
int  numberOfGhostLevels,
int *  wholeExtent 
)
protected

Given ijk indices with respect to WholeExtent, return the process that is considered owning this point.

Here the process that owns the piece will have compuated a valid vertical velocity value to share with other processes that need the integrated vertical velocity value. This method returns -1 if no appropriate piece is found.

◆ GetPiecesNeedingPoint()

void vtkUnstructuredPOPReader::GetPiecesNeedingPoint ( int  iIndex,
int  jIndex,
int  kKindex,
int  numberOfPieces,
int  numberOfGhostLevels,
int *  wholeExtent,
vtkIdList *  pieceIds 
)
protected

Given ijk indices, fill pieceIds with the pieces which contain need this point for computing the vertical velocity.

Note that the pieces with ghost points only used the reader are not included in the returned Id list. The indices are with respect to WholeExtent.

◆ GetExtentInformation()

bool vtkUnstructuredPOPReader::GetExtentInformation ( int  piece,
int  numberOfPieces,
int  numberOfGhostLevels,
int *  wholeExtent,
int *  subExtent 
)
protected

Given piece, numberOfPieces, numberOfGhostLevels, and wholeExtent, this method fills in subExtent.

This method returns true for success.

◆ BuildGhostInformation()

bool vtkUnstructuredPOPReader::BuildGhostInformation ( vtkUnstructuredGrid *  grid,
int  numberOfGhostLevels,
int *  wholeExtent,
int *  subExtent,
int  wrapped,
int  piece,
int  numberOfPieces 
)
protected

Build up the requested ghost information.

Note that if the vertical velocity is computed that the reader needs an extra layer of ghost cells. This extra layer is removed before RequestData() is exited. The method returns true for success.

Member Data Documentation

◆ SelectionObserver

vtkCallbackCommand* vtkUnstructuredPOPReader::SelectionObserver
protected

Definition at line 134 of file vtkUnstructuredPOPReader.h.

◆ FileName

char* vtkUnstructuredPOPReader::FileName
protected

The name of the file to be opened.

Definition at line 139 of file vtkUnstructuredPOPReader.h.

◆ OpenedFileName

char* vtkUnstructuredPOPReader::OpenedFileName
protected

If a file is opened, the file name of the opened file.

Definition at line 145 of file vtkUnstructuredPOPReader.h.

◆ Stride

int vtkUnstructuredPOPReader::Stride[3]
protected

Definition at line 146 of file vtkUnstructuredPOPReader.h.

◆ NCDFFD

int vtkUnstructuredPOPReader::NCDFFD
protected

The NetCDF file descriptor.

Definition at line 154 of file vtkUnstructuredPOPReader.h.

◆ Radius

double vtkUnstructuredPOPReader::Radius
protected

The radius of the sphere to be outputted in meters.

The default value is 6371000.

Definition at line 160 of file vtkUnstructuredPOPReader.h.

◆ VOI

int vtkUnstructuredPOPReader::VOI[6]
protected

Definition at line 162 of file vtkUnstructuredPOPReader.h.

◆ SubsettingXMin

bool vtkUnstructuredPOPReader::SubsettingXMin
protected

State variables so that we know whether or not we are only reading in part of the grid.

SubsettingXMin and SubsettingXMax are used so that we can properly connect the grid in the longitudinal direction. We only compute the vertical velocity if we have the full height resolution of the grid.

Definition at line 172 of file vtkUnstructuredPOPReader.h.

◆ SubsettingXMax

bool vtkUnstructuredPOPReader::SubsettingXMax
protected

State variables so that we know whether or not we are only reading in part of the grid.

SubsettingXMin and SubsettingXMax are used so that we can properly connect the grid in the longitudinal direction. We only compute the vertical velocity if we have the full height resolution of the grid.

Definition at line 173 of file vtkUnstructuredPOPReader.h.

◆ ReducedHeightResolution

bool vtkUnstructuredPOPReader::ReducedHeightResolution
protected

State variables so that we know whether or not we are only reading in part of the grid.

SubsettingXMin and SubsettingXMax are used so that we can properly connect the grid in the longitudinal direction. We only compute the vertical velocity if we have the full height resolution of the grid.

Definition at line 174 of file vtkUnstructuredPOPReader.h.

◆ VectorGrid

int vtkUnstructuredPOPReader::VectorGrid
protected

Specify whether the grid points are at the vector field (U_LAT and U_LON) locations or the scalar field (T_LAT and T_LON) locations or unset.

0 means unset, 2 means vector field, and 1 means scalar field.

Definition at line 182 of file vtkUnstructuredPOPReader.h.

◆ VerticalVelocity

bool vtkUnstructuredPOPReader::VerticalVelocity
protected

If it is a vector grid (i.e.

VectorGrid=2) then specify whether or not to compute the vertical velocity. This can be a costly computation so if the vertical velocity is not needed then keep this off (the default).

Definition at line 190 of file vtkUnstructuredPOPReader.h.


The documentation for this class was generated from the following file: