Thanks very much Ken and others. I just tested the warp by scalar filter (I didn't know about this before) and it looks like it can do what I need with the vertical coord, like you suggested.
What I will do is this: I will modify the netcdf file to add a 1D x and y coord variable with the same name as the x and y dimensions. I will add a 3D coord var for z. If the Paraview netcdf interface can read this in then great! If the Paraview netcdf interface cannot handle the 3D z coord then I will use the warp by scalar filter to apply the z coord var, and will also let you know in case you want to modify the functionality. BTW I found this info about coordinate vars on more than 1 dimension: http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_two_dimensional_latitude_longitude_coordinate_variables I'll try the coordinates attribute as suggested in the link above, and will send you an example netcdf file that I believe to be consistent with CF if it doesn't work in Paraview. Regards, Rupert Gladstone On Tue, May 16, 2017 at 3:39 PM, Moreland, Kenneth <kmo...@sandia.gov> wrote: > Rupert, > > > > It has been multiple years since I really took a look at the CF > convention, so I don’t remember the details of whether it supports varying > coordinates across multiple dimensions or whether the ParaView reader > supports that. If the ParaView reader is missing some corner of the CF > convention, let us know and we can work on that. > > > > In any case, you can displace a 2D or 3D image by a height value that is > stored in a field by simply running the “Warp by Scalar” filter. > > > > -Ken > > > > > > *From: *Rupert Gladstone <rupertgladstone1...@gmail.com> > *Date: *Tuesday, May 16, 2017 at 12:31 AM > *To: *"Moreland, Kenneth" <kmo...@sandia.gov> > *Cc: *Aashish Chaudhary <aashish.chaudh...@kitware.com>, " > paraview@paraview.org" <paraview@paraview.org> > > *Subject: *[EXTERNAL] Re: [Paraview] netcdf > > > > Hi all, thanks very much for your replies so far. I must say I am finding > the Paraview community very helpful. > > Having considered my data further, I would be able to make a 1D coordinate > variable for my x and y dimensions but not for my z dimension. The ocean > model uses a hybrid coordinate which can be transformed into depth, but the > resulting depth coordinate will be spatially varying across my data set. > In other words my z coordinate variable will need to be a 3D variable. > From my understanding of COARDS and CF this is allowed. But I think from > your email that Paraview will not be able to associate this 3D z coordinate > variable to another variable (e.g. ocean temperature) for the purposes of > plotting. At least, not using the Paraview CF interface. Is that correct? > > I don't currently have a handy netcdf file (I have a rather large one). I > could generate a smaller netcdf file to demonstrate the issue, but I am not > sure it is needed here, as the problem is not that Paraview fails to read > the file as expected, but rather than I am trying to clarify what I can > reasonably expect from Paraview with its current functionality. > > Do you have a suggestion for how to read in a (topologically) structured > data set on a rectangular cartesian projection in which the the vertical > coordinate variable varies across all three dimensions? Should I ask > Paraview to read it in as unstructured data? I think I saw that Paraview > offers some kind of interface for unstructured data in netcdf files. Are > the requirements of this documented somewhere? Or do you still feel that I > need to provide an example netcdf file for you to better understand the > problem? > > Thanks again for your help. > > Regards, > > Rupert > > > > > > On Tue, May 16, 2017 at 6:36 AM, Moreland, Kenneth <kmo...@sandia.gov> > wrote: > > Rupert, > > > > As Aashish said, it might be easier to diagnose the issue if you sent us a > file. But if your file is not following the CF or COARDS convention, then > the reader will simply interpret the arrays in the file as uniform grids > with spacing of 1. This is not likely to conform with the coordinates you > want. > > > > The official documentation for the CF convention is maintained here: > http://cfconventions.org/. In summary, you specify coordinates by using > arrays of the same name as the dimension. So for example if you have a 3D > array with dimensions named “Z”, “Y”, and “X”, then you also make a 1D > variable named “X” on the “X” dimension that has the x coordinate for each > grid point in the dimension. Likewise, you have a “Y” variable on the “Y” > dimension for y coordinates and a “Z” variable on the “Z” dimension for the > z coordinates. > > > > Or, if you don’t want to mess with your file format, you can do as Sam > suggested and transform the data once it is loaded into ParaView. > > > > -Ken > > > > > > *From: *ParaView <paraview-boun...@paraview.org> on behalf of Aashish > Chaudhary <aashish.chaudh...@kitware.com> > *Date: *Monday, May 15, 2017 at 9:08 AM > *To: *Rupert Gladstone <rupertgladstone1...@gmail.com>, " > paraview@paraview.org" <paraview@paraview.org> > *Subject: *[EXTERNAL] Re: [Paraview] netcdf > > > > Rupert, > > > > Would it be possible for you to send us a sample file and what the list of > VARS you expect to see in the paraview? > > > > Thanks, > > > > On Mon, May 15, 2017 at 3:37 AM Rupert Gladstone < > rupertgladstone1...@gmail.com> wrote: > > > > Hi, I have a question about netcdf formats. I am developing a coupled ice > sheet - ocean model. Currently both models run in the same cartesian > coordinate system. The ice model outputs unstructured .vtu files, which > paraview reads just fine. The ocean model outputs structured netcdf > files. If I naively select the "generic and CF conventions" option when > reading the ocean netcdf file then the data display ok, but not to scale. > It seems like the structured fields have been read in just fine, but the > coordinate variables have not. I don't think the netcdf files are CF > compliant. I would like to be able to read in both .vtu files and netcdf > files and display the data sets together on the same scale. > > Do you know what I need to do to read in the netcdf coordinate vars > correctly? I am hoping that I can simply insert a post-processing step to > implement some minor manipulation to the ocean model output files so that > Paraview can read them in to scale. Is it simply a case of renaming the > coordinate variables in the netcdf file such that they have the same names > as the corresponding dimensions? Note that this is not in general possible > as some of the coordinate variables are two-dimensional variables (in the > horizontal plane), though for most of the simulations we plan in the near > future I can enforce that the coord vars will have a one to one > correspondence to the dimension vars (i.e. I can enforce that coord vars > are 1D). > > Is the ordering of dimensions important? > Is the ordering of coordinate vars important? > Is the naming of dimensions important? > Is the naming of coord vars important? > Can Paraview cope with 2D coord vars? If so, how does Paraview know which > coordinate var applies to which var? > > Thanks very much for your help. > > Regards, > Rupert Gladstone > > _______________________________________________ > 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