import java.util.*;


public class GaussianSource {
	EquatorialCoordinates coords = new EquatorialCoordinates();
	double peak;
	double FWHM;
	
	public GaussianSource() {}

	public GaussianSource(String line) throws IllegalArgumentException {
		parse(line);
	}
	
	public void parse(String line) throws IllegalArgumentException {
		StringTokenizer tokens = new StringTokenizer(line);
		int entries = tokens.countTokens();
		if(entries < 5) throw new IllegalArgumentException("Not enough arguments to define a Gaussian source.");
		
		tokens.nextToken(); // name
		
		String coordSpec = "";
		for(int i=1; i<=3; i++) coordSpec += tokens.nextToken() + " ";
		//coordSpec = coordSpec.trim();
		
		//System.err.println("'" + coordSpec + "'");
		
		coords.parse(coordSpec);
		FWHM = Double.parseDouble(tokens.nextToken()) * Unit.arcsec;
		peak = Double.parseDouble(tokens.nextToken()) * Unit.V;
	}
}
