All Downloads are FREE. Search and download functionalities are using the official Maven repository.

decodes.util.Pdt2UserNetlists Maven / Gradle / Ivy

Go to download

A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.

The newest version!
package decodes.util;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

import ilex.util.EnvExpander;
import lrgs.common.NetworkList;
import lrgs.common.NetworkListItem;

public class Pdt2UserNetlists
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		if (args.length != 2)
		{
			System.err.println("usage: decj Pdt2UserNetlists  ");
			System.exit(1);
		}
		String filename = EnvExpander.expand(args[0]);
		
		Pdt pdt = new Pdt();
		if (!pdt.load(new File(filename)))
		{
			System.err.println("Cannot open pdt file '" + filename + "'");
			System.err.println("usage: decj Pdt2UserNetlists  ");
			System.exit(1);
		}
		
		String nlDirName = EnvExpander.expand(args[1]);
		File nlDir = new File(nlDirName);
		if (!nlDir.isDirectory())
		{
			System.err.println("Cannot netlist dirctory '" + nlDirName + "' does not exist.");
			System.err.println("usage: decj Pdt2UserNetlists  ");
			System.exit(1);
		}
			
		HashMap agencyNetlistMap = new HashMap();
		for(PdtEntry pdtEntry : pdt.getEntries())
		{
			NetworkList nl = agencyNetlistMap.get(pdtEntry.agency);
			if (nl == null)
			{
				nl = new NetworkList();
				nl.file = new File(nlDirName, pdtEntry.agency + ".nl");
				agencyNetlistMap.put(pdtEntry.agency, nl);
			}
			StringBuilder name = new StringBuilder(pdtEntry.getDescription());
			for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy