Re: [netcdfgroup] Creating a NetCDF file for VisIt with an unstructured grid

Tim et al.,

Unless your data are from a particular simulation code or are defined on a rectilinear mesh, VisIt won't be able to understand them:

  http://www.visitusers.org/index.php?title=Reading_NETCDF

You could also write a custom (NetCDF-based) reader for VisIt to understand whatever conventions you implement. As Rich says, the VisIt community would be happy to push you in the right direction via the visit-users mailing list:

  https://elist.ornl.gov/mailman/listinfo/visit-users

HTH,

-tom

On 03/27/2012 07:19 PM, Rich Signell wrote:
Tim,

If you want to use VisIt with NetCDF files, you have to know what
conventions VisIT expects so you can create VisIT-compatible NetCDF
files.   I seem to remember that they implement some of the CF
conventions, but not all.  The VisIt developers or community should be
able to help you with this.

-Rich


On Tue, Mar 27, 2012 at 10:50 AM, Tim Duly<duly2@xxxxxxxxxxxx>  wrote:
Rich,

Thank you for the information.  My data comes from an unformatted Fortran
file, and Python was the easiest way to read this data.  I'd prefer to use
VisIt as I'd like to extend this project with a 2D plot with time, and then
to a 3D plot with time.

Perhaps I wasn't clear enough-- I have all the data read into Python right
now, but am having trouble writing the coordinate information into the
NetCDF.  I am able to get the actual data into VisIt, but it's not "applied"
to the (200 x 100) matrix X and Y coordinate information.

 From my research, it doesn't look like NetCDF is able to do this.  Perhaps I
should be using another data format for VisIt?

Thanks,
Tim




On Tue, Mar 27, 2012 at 9:20 AM, Rich Signell<rsignell@xxxxxxxx>  wrote:

Tim,

You mention quite a few things here: unstructured grids, Matlab,
NetCDF, CF, Python and Visit.

If your goal is to truly to visualize unstructured grid data from
NetCDF files (or OPeNDAP datasets) using Python, take a look at this
screen shot using Mayavi2

http://dl.dropbox.com/u/12710282/Screenshot-Mayavi.png

and the simple code that produced it:

http://dl.dropbox.com/u/12710282/triangular_mesh_demo.py

Mayavi2 comes with at least two scientific Python distributions:
Python(x,y) (free, works on 32 bit windows) and the Enthought Python
Distribution (free for educational use, works on 32/64 bit windows,
mac and linux).  You should be able to run the above python script
without changes on either distribution.

However, it sounds like you actually have structured grid data in a
text file that you want to use.   In python, I would use numpy
"genfromtxt" to read from the text file, and visualize with Mayavi2's
"surf" function.  See:
http://github.enthought.com/mayavi/mayavi/auto/examples.html

If you want to save your data in a NetCDF file, I'd use the
NetCDF4Python package (also included in the above scientific python
distributions).   This would allow you to visualize it in other tools
as well, like Unidata's IDV.

Good Luck,
-Rich

On Mon, Mar 26, 2012 at 3:31 PM, Tim Duly<duly2@xxxxxxxxxxxx>  wrote:
Hello,

I have a relatively simple task. I have 2D data, of dimension 200x100
that
belong to an unstructured grid that contains X and Y, both of which are
dimension 200x100.  In other words, I have DATA = f(X,Y).

I'm trying to plot this in VisIt, but am having a tough time applying
the
unstructured grid to the actually data.  In MATLAB, for example, this is
easily accomplished with surf(X,Y,DATA), but I'm having difficulties
finding
the equivalent in NetCDF.  How do I do this?  Is this problem solved in
NetCDF or in VisIt?

I am using the Python library NetCDF to transform unformatted Fortran
data
into NetCDF format.  I have read this page

( 
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/cf-conventions.html#id2984605
 )
but I do not understand how to do this with the NetCDF library in
python.
  Should I use another data format besides NetCDF?

Any help would be greatly appreciated.

Thanks,
Tim

_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit:
http://www.unidata.ucar.edu/mailing_lists/



--
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598








  • 2012 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: