import java.util.*; import java.net.URL; import VLAFluxData; import QueryTable; import VLAParameters; import AstroPak; /* ************************************************************************** ** ** Applet parse1d ** ************************************************************************** ** Copyright (C) 1995, 1996 Leigh Brookshaw ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ public class tVLACalFlux { public static void main(String argv[]){ QueryTable table = new QueryTable(new String("aips2.nrao.edu"), 7002); String aliasTable = new String("/home/tarzan/wyoung/VLACalAlias"); String dataTable = new String("/home/tarzan/wyoung/antsol.sum"); String look4 = new String("3C273"); String sourceNames = new String(table.queryTable(new String(" select from " + aliasTable + " where Alias == \"" + look4 + "\""))); System.out.println(sourceNames); String aliases[] = new String [3]; String querySource; StringTokenizer dataIn = new StringTokenizer(sourceNames); if(dataIn.hasMoreTokens()){ aliases[0] = new String(dataIn.nextToken()); aliases[1] = new String(dataIn.nextToken()); aliases[2] = new String(dataIn.nextToken()); if(aliases[2].equals(":")){ querySource = new String("(Source == \"" + aliases[0] + "\" || Source == \"" + aliases[1] +"\")"); } else { querySource = new String("(Source == \"" + aliases[1] + "\" || Source == \"" + aliases[2] +"\" || Source == \""+ aliases[0] +"\")"); } } else { querySource = new String("Source == \"No match\""); } String query = new String("select Source, MJAD, Start, End, Correlator_Mode, El_End, AC_Frequency, BD_Frequency, Mean_AC_Flux, Stddev_AC_Flux, Mean_BD_Flux, Stddev_BD_Flux from " + dataTable + " where " + querySource ); StringTokenizer hits = new StringTokenizer(table.queryTable(query), ":"); int i = 0; while(hits.hasMoreTokens()){ VLAFluxData dataPt = new VLAFluxData(hits.nextToken()); if(dataPt.goodData()) i += 1; } System.out.println(i); System.exit(0); } }