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

Aashish Chaudhary aashish.chaudhary at kitware.com
Fri Jul 24 11:56:56 EDT 2015


Hello,

Is your NetCDF CF compliant? the vtkNetCDF reader makes certain assumption
so it is possible that it hit some condition that made it think that there
is no time information in it.

- Aashish

On Fri, Jul 24, 2015 at 6:15 AM, Manjunath K E <ke.manjunath at gmail.com>
wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 



*| Aashish Chaudhary | Technical Leader         | Kitware Inc.            *
*| http://www.kitware.com/company/team/chaudhary.html
<http://www.kitware.com/company/team/chaudhary.html>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150724/e824b6b7/attachment.html>


More information about the vtkusers mailing list