[vtkusers] NetCDFFile : How to read data for all values of Time axes using vtkNetCDFCFReader.

Manjunath K E ke.manjunath at gmail.com
Fri Jul 24 06:15:50 EDT 2015


Hi all

I am reading a netcdf file using vtkNetCDFCFReader. The input 4 dimensions
(TAXIS, ZAX, YAXIS, XAXIS). But, after reading it, the time varying data is
not read, i.e only *TAXIS = 0* is read.

If XAXIS = 90 ; YAXIS = 60 ;  ZAX = 24 ;  TAXIS =3 ; then I should have the
size of the array being read =  XAXIS * YAXIS *  ZAX *  TAXIS = 90 *  60 *
24 * 3 = 388800.

But since, only one time value is considered then the TAXIS =1, the size of
the array I have read is equall to = 90 *  60 * 24 * 1 (time axis)= 129600.

So, please help me how read time varrying data. i.e How to read data for
all values of Time axes using vtkNetCDFCFReader.

My current code is as below :
====================================================================
def readNetCdfFile(netCdfFilename, arrayName) :
        netCdfReader = vtkNetCDFCFReader()
        netCdfReader.SetFileName(netCdfFilename)
        netCdfReader.SphericalCoordinatesOff()
        netCdfReader.SetReplaceFillValueWithNan(1)
        netCdfReader.Update()
        #Copy input Array to scalar value field of point data ..this makes
point data to point to SAL array
netCdfReader.GetOutput().GetPointData().SetScalars(netCdfReader.GetOutput().GetPointData().GetArray(arrayName))
        netCdfReader.UpdateMetaData()
        netCdfReader.Update()
        netCdfReader.GetOutput().UpdateInformation()
        return netCdfReader
====================================================================


 Thanks and Regards,

 Manjunath K E
 Help Ever Hurt Never
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150724/9e89bc9c/attachment-0001.html>


More information about the vtkusers mailing list