Ncview 1.75 Mar 20, 1999 -- David W. Pierce -------------------------------------------- Overview: What Ncview *is*. --------------------------- This is the source for "ncview", a X Windows (Release 4 or higher) visual browser for netCDF data format files. Ncview displays a 2-dimensional, color representation of data in a netCDF file. You can animate the data in time (making simple movies), flip or enlarge the picture, scan through various axes, change colormaps, etc. You can also plot the data in X-Y plots and then print those, courtesy of the SciPlot widget from Robert W. McMullen . What Ncview *isn't*. -------------------- Ncview is *not* an analysis package. There are several excellent commercial packages available for that. Rather, its purpose in life is to view movies or simple plots of data stored in netCDF format files quickly, easily, and simply. To view your data in a 'movie', all you do is fire Ncview up and press a couple buttons--that's it! To make a plot, just click on the movie! By contrast, analysis programs often require a lot of overhead massaging the data before you can do much. I've tested this on DEC 5000s and DEC Alphas, IBM RS/6000s, SGI workstations, and Linux machines. It should also work with Suns now. If you port it to a new platform, please mail me any changes which are required! Getting ncview -------------- The latest version of Ncview is available for anonymous ftp from cirrus.ucsd.edu:/pub/ncview. If you can't compile it, and need binaries, e-mail me and I'll see if I can find binaries for your platform. Building ncview --------------- Short form, presuming everything goes well: 1) Decide whether you want support for the "udunits" package. If you do, make it separately (source is included in the ncview package, strictly as a convenience. Udunits is available from: http://www.unidata.ucar.edu/packages/udunits/index.html). Make the package and set environmental variable UDUNITS_PATH to the location of the "udunits.dat" file. If you do NOT want it, comment out the lines in the Imakefile as indicated therein. 2) type "xmkmf" 3) type "make" 4) type "make install" (to install by hand, see below) Long form: 1) To build ncview, you must have the netCDF library and include headers already installed. The netCDF package is available by anonymous ftp from unidata.ucar.edu. If you have problems with Ncview, make SURE you have the latest version of the netCDF library installed! 2) By default, the Imakefile looks for the netCDF library and include header files in the following locations: /usr/local/include for the netCDF include file "netcdf.h" /usr/local/lib for the netCDF library file "libnetcdf.a" If these are different on your system, then edit the Imakefile to set the locations of your netCDF and include files as appropriate. 3) Ncview puts copies of the colormap files (files with extension ".ncmap") in a system-wide directory, whose location defaults to "/usr/local/lib/ncview". If you want to change this location, edit the Imakefile and change the value of "NCVIEW_LIB_DIR" accordingly. If you don't want any system-wide directory at all, comment the line out; you can then put the .ncmap files in one of 3 places: 1) In a directory named by the environmental variable "NCVIEWBASE"; 2) In your home directory, if you don't define NCVIEWBASE; 3) In the directory which you are running ncview from. 4) Ncview uses the Athena Widget Set, Release 4 or higher. The header files for the widget set need to be in a directory named "Xaw" (this is set in "ncview.includes.h"), and the Imakefile assumes that the Xaw directory is a subdirectory of the standard X include file directory. If this is NOT true, add the directory where the Xaw subdirectory lives to the symbol "OTHERINCDIR" in the Imakefile. The Imakefile assumes the the library file "libXaw.a" is located with the other X libraries. If this is NOT true, add the location of the Xaw library file to the symbol "OTHERLIBDIR" in the Imakefile. In general this is not a problem, and you are not likely to have to change the default values for these. 5) Ncview uses the "udunits" package from unidata (http://www.unidata.ucar.edu/packages/udunits/index.html) to perform time conversions on time variables that are written to agree with the udunits conventions. These often have a name similar to "days since 1900-01-01". If ncview finds a time axis with units that are recognized by the udunits package, then a calendar date is displayed instead of a raw day count. For instance, the date "1 Jun 1995" might be shown, instead of day "3962". If you want this support, first go into the udunits source directory and make the udunits package. Then set the environmental variable UDUNITS_PATH to the location of the "udunits.dat" file. If you do NOT want this support, then edit the Imakefile to comment out the four lines indicated therein. 6) Type 'xmkmf'. This will generate a Makefile appropriate for your system. If you do not have 'xmkmf', a default Makefile is provided in 'Makefile.default'. Edit this to reflect the location of your X libraries (if they are in non-standard places), then copy it to 'Makefile'. 7) Type 'make'. This should build ncview. If you have problems making: * try using the GCC compiler; it's the compiler I use on the Sun and HP systems, since the version of the compilers I have for those systems isn't ANSI compatible. * Try using "Makefile.default" instead of "xmkmf". This is especially true on systems that don't HAVE xmkmf. I.e., do the following: cp Makefile.default Makefile make You might have to edit the Makefile in this case to put in the proper library and include file directories. A test netCDF data file is available from unidata.ucar.edu in file /pub/netcdf/sample_data/aP.nc. Installation ------------ Type "make install". If you used the default setup, with a defined NCVIEW_LIB_DIR, that should be it. If you undefined NCVIEW_LIB_DIR, you will have to copy the ".ncmap" files from the distribution directory to the place where you want to keep them. As mentioned above, there are three choices: 1) In a directory named by the environmental variable "NCVIEWBASE"; 2) In your home directory, if you don't define NCVIEWBASE; 3) In the directory which you are running ncview from. If you don't do this, ncview will not know where to look for .ncmap files. You will know this is the case if ncview complains upon startup that it can't find any .ncmap files, and is using only the default colormap. Make SURE that the resources file, "Ncview", is visible to your system!!! If you "make install" as root, this should be taken care of; if this is not possible, then copy the file named "Ncview" into the directory pointed to by your XAPPLRESDIR environmental variable (which might be "$HOME/.app-defaults", for example). Otherwise some elements of the display will not be lined up properly. A manual entry is included in the distribution, ncview.1. The 'install' entry in the Makefile runs ncview.1.sed through sed to convert the generic references to the location of the ncview lib directory to the specific place applicable to your installation. To have the udunits part work, the udunits file must be in the proper place. Look in the udunits documentation to find out more about this issue. In general, you can set the environmental variable UDUNITS_PATH to the location of the file "udunits.dat", which generally lives in directory "etc" of the udunits source tree: "udunits-1.11.7/etc". To Install by Hand ------------------ You can also install by hand if you want. A quick overview: a) make a /usr/local/lib/ncview directory: mkdir /usr/local/lib/ncview b) put all the colormaps (*.ncmap) and overlays (nc_overlay.*) into that directory: cp *.ncmap nc_overlay.* /usr/local/lib/ncview/. c) copy the Ncview app-defaults file over to the system app defaults directory (usually /usr/lib/X11/app-defaults): cp Ncview /usr/lib/X11/app-defaults/. d) copy ncview itself to /usr/local/bin: cp ncview /usr/local/bin/ncview Special note for Mac-X users ---------------------------- I've tested Ncview using MacX version 1.1.6, and it works, with the following notes. 1) You need to use screen 2. So, if your machine name is "blegga", you should set your DISPLAY environmental variable to "blegga:0.2". 2) The colors may come out oddly. If so, change the value of the "*background" resource in the Ncview app-defaults file. I've had good luck with "blue" instead of the default value of "black". Copying, etc. ------------- Ncview is freely redistributable, but is not public domain. It is copyright (C) 1993 through 1999 David W. Pierce. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 1 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 1, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The SciPlot widget is Copyright (c) 1995 Robert W. McMullen . You can visit the SciPlot web page at http://www.ae.utexas.edu/~rwmcm/SciPlot.html. ------------------------ David W. Pierce 6259 Caminito Carrena San Diego, CA 92122 dpierce@ucsd.edu