Re: Opening and Closing Plain


Kevin Manross wrote:

Is there a way to "unload" or close one netCDF file and then "load" or open a new netCDF file while the program is still running?

I have an application where a user can chose a radar site. When a site is chosen, it should read a terrain map (netCDF) into VisAD. If the user then wants to chose a different site, the application should unload the existing netCDF file, clear all the associated maps from VisAD implementations, and load the new netCDF file.

If the files are of the same format, you should just be able to

    <set up your display, ScalarMaps, and DataReference etc>
    Plain plain = new Plain();
    Data plainData =<first file location>);
    <user chooses new file>
    plainData =<second file location>);

If it's in a new location, you might have to call

or if you are manually setting the ranges on the scalar maps,
figure them out from the new data and call their setRange

Currently I am using Plain, but there does not appear to be any close() method for Plain.

There is no close() on Plain, but you can use a single instance
to load in multiple files.  The original files should get garbage

Any help is greatly appreciated!

If any of the above does not make sense, let me know.

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307

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