private void readHDR() throws IOException { String location = raf.getLocation(); int pos = location.lastIndexOf('.'); String HDRname = location.substring(0, pos) + ".HDR"; String HDRcontents = IO.readFile(HDRname); StringTokenizer stoke = new StringTokenizer(HDRcontents); while (stoke.hasMoreTokens()) { String key = stoke.nextToken(); if (key.equals("ULXMAP")) startx = Float.parseFloat(stoke.nextToken()); else if (key.equals("ULYMAP")) starty = Float.parseFloat(stoke.nextToken()); else stoke.nextToken(); } }
private void readHDR() throws IOException { String location = raf.getLocation(); int pos = location.lastIndexOf('.'); String HDRname = location.substring(0, pos) + ".HDR"; String HDRcontents = IO.readFile(HDRname); StringTokenizer stoke = new StringTokenizer(HDRcontents); while (stoke.hasMoreTokens()) { String key = stoke.nextToken(); if (key.equals("ULXMAP")) startx = Float.parseFloat(stoke.nextToken()); else if (key.equals("ULYMAP")) starty = Float.parseFloat(stoke.nextToken()); else stoke.nextToken(); } }
private void readHDR() throws IOException { String location = raf.getLocation(); int pos = location.lastIndexOf('.'); String HDRname = location.substring(0, pos) + ".HDR"; String HDRcontents = IO.readFile(HDRname); StringTokenizer stoke = new StringTokenizer(HDRcontents); while (stoke.hasMoreTokens()) { String key = stoke.nextToken(); if (key.equals("ULXMAP")) startx = Float.parseFloat(stoke.nextToken()); else if (key.equals("ULYMAP")) starty = Float.parseFloat(stoke.nextToken()); else stoke.nextToken(); } }
public static void main(String[] args) throws IOException, ParseException { String testFile = "E:/work/yuan/shapefile/SkiAreaBoundaries.prj"; //String filename = ( args != args[0] == null) ? testFile : args[0]; String contents = IO.readFile(testFile); System.out.printf("%s%n", contents); WKTParser p = new WKTParser(contents); ProjectionImpl proj = convertWKTToProjection(p); System.out.printf("%s%n", proj); } }
public static void main(String[] args) throws IOException, ParseException { String testFile = "E:/work/yuan/shapefile/SkiAreaBoundaries.prj"; //String filename = ( args != args[0] == null) ? testFile : args[0]; String contents = IO.readFile(testFile); System.out.printf("%s%n", contents); WKTParser p = new WKTParser(contents); ProjectionImpl proj = convertWKTToProjection(p); System.out.printf("%s%n", proj); } }
public static void main(String[] args) throws IOException, ParseException { String testFile = "E:/work/yuan/shapefile/SkiAreaBoundaries.prj"; //String filename = ( args != args[0] == null) ? testFile : args[0]; String contents = IO.readFile(testFile); System.out.printf("%s%n", contents); WKTParser p = new WKTParser(contents); ProjectionImpl proj = convertWKTToProjection(p); System.out.printf("%s%n", proj); } }
static public void makeStandardCacheManager(String configFile, String cacheDir) throws IOException { String config = IO.readFile(configFile); String configString = StringUtil2.substitute(config, "${cacheDir}", cacheDir); cacheLog.info("thredds.filesystem.CacheManager configuraton " + configString); cacheManager = new net.sf.ehcache.CacheManager(new StringBufferInputStream(configString)); }
public void testAggExisting() throws IOException { String filename = TestDir.cdmUnitTestDir + "ncml/remote.ncml"; System.out.printf(" testAggExisting: read %s%n%n%s", filename, IO.readFile(filename)); NetcdfDataset ncd = NetcdfDataset.openDataset(filename); System.out.println(" testAggExisting.open "+ ncd); Variable sst_time = ncd.findVariable("sst_time"); assert sst_time != null; assert sst_time.getRank() == 2; int[] shape = sst_time.getShape(); assert shape[0] == 6; assert shape[1] == 1; ncd.close(); } }
public static void main(String args[]) throws IOException { String fileOut = "resource:/resources/bufrTables/local/ncep/DataSubCategories.csv"; try (PrintStream pout = new PrintStream(fileOut, CDM.UTF8)) { readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.000.txt", pout, "MSG TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.001.txt", pout, "MESSAGE TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.002.txt", pout, "MSG TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.003.txt", pout, "MTYP "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.004.txt", pout, "MSG TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.005.txt", pout, "MSG TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.006.txt", pout, "M TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.007.txt", pout, "MTYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.008.txt", pout, "MSG TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.012.txt", pout, "M TYPE "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.021.txt", pout, "MTYP "); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.031.txt", pout, "031-"); readSubCategories("C:/dev/github/thredds/bufr/src/main/sources/ncep/bufrtab.255.txt", pout, "MTYP "); } System.out.printf("=======================================%n"); System.out.printf("%s%n", IO.readFile(fileOut)); System.exit(0); String location = "resource:/resources/bufrTables/local/ncep/ncep.bufrtab.ETACLS1"; try (InputStream ios = BufrTables.openStream(location)) { BufrTables.Tables tables = new BufrTables.Tables(); NcepMnemonic.read(ios, tables); Formatter out = new Formatter(System.out); tables.b.show(out); tables.d.show(out); } }