edu.nrao.sss.dao.source
Class VlbaCatalogUpdater

java.lang.Object
  extended by edu.nrao.sss.dao.source.VlbaCatalogUpdater

public class VlbaCatalogUpdater
extends Object

An updater of VLBA Source Catalogs. When run as a program (see main(String[]), this class updates or replaces the official VLBA Calibrator Catalog.

Version Info:

$Revision$
$Date$
$Author$ (last person to modify)

Since:
2007-06-15
Author:
David M. Harland

Constructor Summary
VlbaCatalogUpdater()
          Creates a new VLBA Source Catalog Updater.
 
Method Summary
 StringBuilder getErrorMessages()
          Returns the messages produced during the most recent read of a text file.
 SourceCatalog getNewCatalog()
          Returns the most recently read catalog.
 SourceCatalog getNewCatalog(URL inputTextFile, StringBuilder errorMessages)
          Creates a new catalog from inputTextFile and returns it.
static void main(String[] args)
          A program that updates or replaces the official VLBA Calibrator Catalog.
 SourceCatalog updateCatalog(SourceCatalog destination, SourceCatalog recycleBin, StringBuilder errorMessages)
          Uses the most recently read catalog to update destination and recycleBin.
 SourceCatalog updateCatalog(URL inputTextFile, SourceCatalog destination, SourceCatalog scrapHeap, StringBuilder errorMessages)
          Creates a new catalog from inputTextFile and uses it to update destination and scrapHeap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VlbaCatalogUpdater

public VlbaCatalogUpdater()
Creates a new VLBA Source Catalog Updater.

Method Detail

getNewCatalog

public SourceCatalog getNewCatalog(URL inputTextFile,
                                   StringBuilder errorMessages)
                            throws IOException
Creates a new catalog from inputTextFile and returns it.

Parameters:
inputTextFile - location of a text file that contains sources in VLBA format.
errorMessages - a place to put any messages from the catalog reader. The presence of a message does not always imply that the read failed.
Returns:
the catalog that was created from inputTextFile.
Throws:
IOException - if the input file cannot be read.

getNewCatalog

public SourceCatalog getNewCatalog()
Returns the most recently read catalog.

Returns:
the most recently read catalog, or null if none have been read.

updateCatalog

public SourceCatalog updateCatalog(URL inputTextFile,
                                   SourceCatalog destination,
                                   SourceCatalog scrapHeap,
                                   StringBuilder errorMessages)
                            throws IOException
Creates a new catalog from inputTextFile and uses it to update destination and scrapHeap.

Parameters:
inputTextFile - location of a text file that contains sources in VLBA format.
destination - the catalog that will be updated as a result of this call.
scrapHeap - a place to put any sources removed from destination as a result of the instructions found in inputTextFile.
errorMessages - a place to put any messages from the catalog reader. Note that the presence of a message does not always imply that the read failed.
Returns:
the catalog that was created from inputTextFile.
Throws:
IOException - if the input file cannot be read.

updateCatalog

public SourceCatalog updateCatalog(SourceCatalog destination,
                                   SourceCatalog recycleBin,
                                   StringBuilder errorMessages)
Uses the most recently read catalog to update destination and recycleBin.

Parameters:
destination - the catalog that will be updated as a result of this call.
recycleBin - a place to put any sources removed from destination as a result of the instructions found in inputTextFile.
Returns:
the most recently read catalog, or null if none has been read.

getErrorMessages

public StringBuilder getErrorMessages()
Returns the messages produced during the most recent read of a text file.

Returns:
the messages produced during the most recent read of a text file.

main

public static void main(String[] args)
                 throws Exception
A program that updates or replaces the official VLBA Calibrator Catalog.

Usage


   java VlbaCatalogUpdater (-replace | -update [yyyy.mm.dd]) -input URL
   
     where
       VlbaCatalogUpdater is shorthand for the fully qualified name,
           edu.nrao.sss.dao.source.VlbaCatalogUpdater
           
       Exactly one of -replace or -update must be specified.
       If -replace is specified, the VLBA Calibrator Catalog will
       be replaced by the one read from a text file.  If -update is
       specified, the VLBA Calibrator Catalog will be updated based on
       the Modification Code given for a particular source.
       
       yyyy.mm.dd is an optional parameter that has an effect only
       when -update is specified.  This parameter represents the
       earliest date for which updates will be made.  Sources with
       modification dates prior to this one will not be processed.
       The default value of this parameter is 1900.01.01.
       Note: if you use a separator other than '.', you will not get the
       results you expect.
       
       -input is a mandatory option.  Its value, URL,
       is the name of the text file to be processed.
 
This program will also attempt to use the 2007a_astro catalogue, to populate the VLBA catalog with image, FITS file, and CLEAN file links.

Parameters:
args - the command line parameters to this program.
Throws:
Exception - if anything goes wrong during processing.


Copyright © 2009. All Rights Reserved.