filterCatalog (version 1.6)
index
/acs/science/pipeline/lib/python/apsis/filterCatalog.py

# $Id: filterCatalog.py,v 1.6 2003/01/14 17:47:25 anderson Exp $
# ---------------------------------------------------------------------
# $Log: filterCatalog.py,v $
# Revision 1.6  2003/01/14 17:47:25  anderson
# null revision.  fix for Bugzilla bug # 2181 is in the base class, Catalog,
# in the catalog.py module.
#
# Revision 1.5  2002/08/22 16:25:42  anderson
# Revision addresses Bugzilla bug #1689:
# Some catalog parameter values are too long
#
# Revision 1.4  2002/07/03 20:20:30  anderson
# Revision to the constructor to accept a passed list of excludable
# fields for the xml markup.  This list is passed to the writeXml
# method.  The filterCatalog class constructor sets the default
# excludeList to contain X_IMAGE, Y_IMAGE.
# See Bugzilla bug #1433
#
# Revision 1.3  2002/05/16 18:46:13  anderson
# Bringing all apsis modules to a common rev level.
# K Anderson
#
# Revision 1.1.1.1  2002/05/03 17:39:34  anderson
# initial revision and release of the ACS Science pipeline, apsis
#
# ---------------------------------------------------------------------
# created 8-11-01
# subclass of catalog.Catalog class.  Provides the run2() method to 
# allow the caller to run SExtractor in dual image mode.  Also
# provides a main function to run the whole thing and set up the
# parameters which the ACS group has identified as the nominal
# input parameter set by using provided weight images and RMS maps.
# K Anderson

 
Modules
            
os
popen2
string
 
Classes
            
catalog.Catalog
filterCatalog
 
class filterCatalog(catalog.Catalog)
      Example usage:
 
Filter Catalog creation:
========================
 
se = filterCatalog.filterCatalog(obs)             # Create an instance
                                                  # obs is the DataSet object (instance of DataSet)
se.setinpar('FILTER_NAME', 'gauss_2.0_3x3.conv')  # change a parameter from .inpar
se.setpars()                                      # generates the .inpar and .param files in obsdir/par
se.run2()                                         # Run source extractor--dual image mode. 
se.writeXmlCatalog()                              # writes .xml files from .cat files in obsdir/cat
se.logfile.write(string)                          # write an entry to the logfile
 
 
NOTES:
- use of the inherited run() method for the filterCatalog instance is deprecated.
  All filter catalogs should be produced by dual image
  execution. Only when one filter's data is available should run() be called.
- input parameters are those in the .inpar file
- default input parameters are read from  the SExtractor.inpar file
  in the pipeline pars directory ($PIPELINE/pars).
- setinpar method is available.  The pipeline will call this
  method to adjust output parameters for a particular observation's
  data and environment.
- output parameters are read from the SExtractor.param file
  in the pipeline pars directory ($PIPELINE/pars).
- the setoutpar method is NOT available. output parameters should be
  adjusted in the default .param this module reads.
- cross-correlation using ASSOC* input parameters is not supported yet
- writeXml method now writes a .xml file from the .cat file
 
   Methods defined here:
__init__(self, obs, excludeList=['X_IMAGE', 'Y_IMAGE'])
adjusted constructor to allow a passed excludeList for the 
exclusion of a passed list of fields from the xml markup.
run2(self)
Run SExtractor on the sciImageList in dual image mode (i.e. detection image vs filter image)

Data and non-method functions defined here:
__doc__ = '\n Example usage:\n\n Filter Catalog crea...ow writes a .xml file from the .cat file\n\n '
__module__ = 'filterCatalog'

Methods inherited from catalog.Catalog:
getinpar(self, param)
Returns value of input parameter given a parameter name
getoutpar(self, param)
Returns value of input parameter given a parameter name
mkMsg(self)
create and write module level message for this class.
Most of this is just compiling the info. meta in a dictionary
of lists where each list is a list of tuples describing the
tag lines for the particular section of the message.  This tuple 
format conforms to that used by the xmlMessage class which is
modeled on basic python argument passing, i.e. (key,*value,**attr).
run(self)
Runs SExtractor on the list of fits files in sciImageList in single image
mode.
setinpar(self, param, value)
Sets value of input parameter given a parameter name and value
setpars(self, fitsfile)
 generate the .inpar and .param files for a passed fitsfile.
writeXml(self)
writeXml calls the xmlUtil catalog functions on a list of source catalogs
produced by SExtractor of the observation object and also calls the
markupImage function (xmlUtil) on the segmentation images produced
by SExtractor. New requirements for the markup now mean the pipeline
has to include the filter name in the catalog tag of the xml file.
filterName func returns the _useful_ filter name, i.e. the one that is
not clear.  This is now part of the argument list that goes to the 
xmlStartCat function. A new requirement has been placed upon
this writeXml method to allow certain fields of a catalog file
to be excluded from the xml markup.  This is done to avoid redundant
fields for the same objects being sent to the SDA.  See Bugzilla
bug #1436.
 
Functions
            
main(obs, wtfile)
Just cobbles all the method calls and runs it all with one call.
 
Data
             __author__ = 'Ken Anderson, anderson@pha.jhu.edu'
__file__ = '/acs/science/pipeline/lib/python/apsis/filterCatalog.pyc'
__name__ = 'filterCatalog'
__version__ = '1.6'
__version_date__ = '2003/01/14 17:47:25'
 
Author
             Ken Anderson, anderson@pha.jhu.edu