[Paraview] troubles with netCDF reader ?

Dan Lipsa dan.lipsa at kitware.com
Tue Aug 8 16:40:45 EDT 2017


Hi Cynthia,
It is possible to change the reader. You'll need to compile ParaView from
source. The class you need to change is vtkNetCDFCFReader.
Probably you'll need an extra parameter to the reader that would be the
time unit. The time unit read from the file should overides this parameter.

You could also submit your changes back to VTK (most readers in ParaView
are actually part of VTK). This seems like something other people might
need.

Dan




On Tue, Aug 8, 2017 at 12:43 PM, Hart, Cynthia Joyce - (cyndyb) <
cyndyb at email.arizona.edu> wrote:

> Hello,
>
>
>
> To make a long story short, this solution you used below, does not work
> well for the weather forecasting group here on my campus that I am working
> with.  Is there any possibility of obtaining the source code of the
> Paraview netCDF reader?  If I could edit that source code to accept the
> non- CF compliant WRF outputs, I could make use of Paraview in an automated
> script to create animations for our forecasters much, much more readily
> than manipulating netCDF file headers.  The data I’d sent to you was but a
> very small subset of the hundreds of netCDF files we’d need to change,
> every time we do a model run, and this is a process we’d like to actually
> automate daily.  I am unable to force the output to be compliant as it is
> created.  Can you help?
>
>
>
> Sincerely,
>
>
>
> Cynthia Hart
>
>
>
>
>
> *From: *Dan Lipsa <dan.lipsa at kitware.com>
> *Date: *Friday, June 23, 2017 at 10:57 AM
> *To: *Aashish Chaudhary <aashish.chaudhary at kitware.com>
> *Cc: *"Hart, Cynthia Joyce - (cyndyb)" <cyndyb at email.arizona.edu>, "
> paraview at paraview.org" <paraview at paraview.org>
> *Subject: *Re: [Paraview] troubles with netCDF reader ?
>
>
>
> Cynthia,
>
> It seems that the files you send us are not CF compliant.
>
> The problem is that the Time dimension does not have a unit.
>
>
>
>
>
> Here are some quotes from the CF Conventions document:
>
> - The use of coordinate variables is required for all dimensions that
> correspond to one dimensional space or time coordinates.
>
> - Variables representing time must always explicitly include the units
> attribute; there is no default value
>
>
>
> So, to fix one of your files, I did:
>
>
>
> 1. ncdump ARAD4_test2.ncdf > ARAD4_test2_CF.txt
>
>
>
> 2. I added a new variable Time with the unit specified to the txt file.
>
>
>
> float Time(Time) ;
>
> Time:units = "minutes since 2016-07-29 12:00:00" ;
>
>
>
> 3.
>
> I generated a new nc file:
>
> ncgen ARAD4_test2_CF.txt -o  ARAD4_test2_CF.nc
>
>
>
> This new file is read correctly by ParaView.
>
>
>
> Best,
>
> Dan
>
>
>
>
>
>
>
> On Fri, Jun 16, 2017 at 6:31 PM, Aashish Chaudhary <
> aashish.chaudhary at kitware.com> wrote:
>
> Dear Cynthia,
>
>
>
> Is there any chance that you can send me a sample dataset?
>
>
>
> - Aashish
>
>
>
> On Fri, Jun 16, 2017 at 6:15 PM Hart, Cynthia Joyce - (cyndyb) <
> cyndyb at email.arizona.edu> wrote:
>
> Folks –
>
>
>
> I am struggling with using the netCDF reader, with a bunch of timeseries
> of WRF data output (weather prediction modeling).  I am a visualizer, NOT a
> meteorologist, and so, my full understanding of the model’s output is shaky
> at best.  The researcher I am trying to assist is currently on vacation,
> and I’m trying to animate the output of his WRF model.
>
>
>
> So!  I have been viewing some of the output using the built in reader in
> Paraview (the ‘generic and cf’ reader) and it works for some variables, not
> for others.  I am using NCO tools to extract some of the variables of
> interest into their own CDF file, to try and isolate the problem Paraview
> has, reading some variables.. but that doesn’t help.  I am particularly
> trying to read a variable for radar data, “REFL_10CM”.  Here is the
> relevant bit of the file header from ncdump, below:
>
>
>
> netcdf ARAD4_test2 {
>
> dimensions:
>
>                 Time = UNLIMITED ; // (1 currently)
>
>                 south_north = 393 ;
>
>                 west_east = 639 ;
>
>                 bottom_top = 37 ;
>
> variables:
>
>                 float REFD_MAX(Time, south_north, west_east) ;
>
>                                 REFD_MAX:FieldType = 104 ;
>
>                                 REFD_MAX:MemoryOrder = "XY " ;
>
>                                 REFD_MAX:description = "MAX DERIVED RADAR
> REFL" ;
>
>                                 REFD_MAX:units = "dbZ" ;
>
>                                 REFD_MAX:stagger = "" ;
>
>                                 REFD_MAX:coordinates = "XLONG XLAT XTIME"
> ;
>
>                 float REFL_10CM(Time, bottom_top, south_north, west_east) ;
>
>                                 REFL_10CM:FieldType = 104 ;
>
>                                 REFL_10CM:MemoryOrder = "XYZ" ;
>
>                                 REFL_10CM:description = "Radar
> reflectivity (lamda = 10 cm)" ;
>
>                                 REFL_10CM:units = "dBZ" ;
>
>                                 REFL_10CM:stagger = "" ;
>
>                                 REFL_10CM:coordinates = "XLONG XLAT
> XTIME" ;
>
>                 float XLAT(Time, south_north, west_east) ;
>
>                                 XLAT:FieldType = 104 ;
>
>                                 XLAT:MemoryOrder = "XY " ;
>
>                                 XLAT:description = "LATITUDE, SOUTH IS
> NEGATIVE" ;
>
>                                 XLAT:units = "degree_north" ;
>
>                                 XLAT:stagger = "" ;
>
>                                 XLAT:coordinates = "XLONG XLAT" ;
>
>                 float XLONG(Time, south_north, west_east) ;
>
>                                 XLONG:FieldType = 104 ;
>
>                                 XLONG:MemoryOrder = "XY " ;
>
>                                 XLONG:description = "LONGITUDE, WEST IS
> NEGATIVE" ;
>
>                                 XLONG:units = "degree_east" ;
>
>                                 XLONG:stagger = "" ;
>
>                                 XLONG:coordinates = "XLONG XLAT" ;
>
>                 float XTIME(Time) ;
>
>                                 XTIME:FieldType = 104 ;
>
>                                 XTIME:MemoryOrder = "0  " ;
>
>                                 XTIME:description = "minutes since
> 2016-07-29 12:00:00" ;
>
>                                 XTIME:units = "minutes since 2016-07-29
> 12:00:00" ;
>
>                                 XTIME:stagger = "" ;
>
>
>
> Paraview complains that it cannot read a variable with more than three
> dimensions without time.  But there appears to ‘be’ time (I’m very unclear
> what “UNLIMITED” time , as seen in the header, refers to in this context).
> Is there any way I can work around this?  Most frustrating.   I can
> actually read this variable into QGIS, but I’d rather use the strengths of
> Paraview to visualize this data.
>
>
>
> Thanks in advance.
>
>
>
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170808/99c852e3/attachment.html>


More information about the ParaView mailing list