@@ -0,0 +1,2747 @@
+/*%0ACopyright (c) 2014, Colorado State University%0AAll rights reserved.%0A%0ARedistribution and use in source and binary forms, with or without modification,%0Aare permitted provided that the following conditions are met:%0A%0A1. Redistributions of source code must retain the above copyright notice, this%0A   list of conditions and the following disclaimer.%0A2. Redistributions in binary form must reproduce the above copyright notice,%0A   this list of conditions and the following disclaimer in the documentation%0A   and/or other materials provided with the distribution.%0A%0AThis software is provided by the copyright holders and contributors %22as is%22 and%0Aany express or implied warranties, including, but not limited to, the implied%0Awarranties of merchantability and fitness for a particular purpose are%0Adisclaimed. In no event shall the copyright holder or contributors be liable for%0Aany direct, indirect, incidental, special, exemplary, or consequential damages%0A(including, but not limited to, procurement of substitute goods or services;%0Aloss of use, data, or profits; or business interruption) however caused and on%0Aany theory of liability, whether in contract, strict liability, or tort%0A(including negligence or otherwise) arising in any way out of the use of this%0Asoftware, even if advised of the possibility of such damage.%0A*/%0A%0Apackage galileo.samples;%0A%0Aimport galileo.dataset.Metadata;%0Aimport galileo.util.FileNames;%0Aimport galileo.util.Pair;%0A%0Aimport java.io.File;%0Aimport java.util.Map;%0A%0Aimport ucar.nc2.util.DiskCache;%0A%0Apublic class DumpNetCDF %7B%0A    public static void main(String%5B%5D args)%0A    throws Exception %7B%0A        DiskCache.setCachePolicy(true);%0A%0A        File f = new File(args%5B0%5D);%0A        Pair%3CString, String%3E nameParts = FileNames.splitExtension(f);%0A        String ext = nameParts.b;%0A        if (ext.equals(%22grb%22) %7C%7C ext.equals(%22bz2%22) %7C%7C ext.equals(%22gz%22)) %7B%0A            Map%3CString, Metadata%3E metaMap%0A                = ConvertNetCDF.readFile(f.getAbsolutePath());%0A%0A            /* Don't cache more than 1 GB: */%0A            DiskCache.cleanCache(1073741824, null);%0A%0A            String%5B%5D attribs = %7B %22temperature_surface%22,%0A                %22total_cloud_cover_entire_atmosphere%22,%0A                %22visibility_surface%22,%0A                %22pressure_surface%22,%0A                %22categorical_snow_yes1_no0_surface%22,%0A                %22categorical_rain_yes1_no0_surface%22,%0A                %22relative_humidity_zerodegc_isotherm%22 %7D;%0A            Metadata m = metaMap.get(%229x%22);%0A            System.out.print(%229x@%22%0A                    + m.getTemporalProperties().getStart() + %22%5Ct%22);%0A            for (String attrib : attribs) %7B%0A                System.out.print(m.getAttribute(attrib).getString() + %22%5Ct%22);%0A            %7D%0A            System.out.println();%0A        %7D%0A    %7D%0A%7D%0A

Add DumpNetCDF sample