| | |
- __builtin__.object
-
- se_catalog
-
- rw_catalog
- sextractor
class rw_catalog(se_catalog) |
| |
Extend the se_catalog class to support adding new columns,
and writing out the new version. |
| |
- Method resolution order:
- rw_catalog
- se_catalog
- __builtin__.object
Methods defined here:
- __init__(self, fname)
- addcolumn(self, colname, coldata)
- coldata must be a 1d numarray of the correct length
- addemptycolumn(self, colname, coltype)
- Defines a new column & updates all the bookkeeping, but
does not actually fill in the data.
- line(self, rownum)
- Construct a new line as to be printed out
- printme(self)
- Like writeto, but for sys.stdout
- writeto(self, outname, clobber=False)
Methods inherited from se_catalog:
- __iter__(self)
- __len__(self)
- buildheader(self)
- Reconstruct the header from the header dictionary.
This might be useful if only a few columns were selected
from the file; otherwise just use the 'header' attribute.
- getcol(self, col, offset=0)
- getcols(self, *args)
- gettypes(self)
Data descriptors inherited from se_catalog:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class se_catalog(__builtin__.object) |
| |
Read a SExtractor-style catalog.
Usage: c=se_catalog(catalog,readfile=True,preserve_case=False)
Will read the catalog and return an object c, whose attributes are
arrays containing the data. For example, c.mag_auto contains the
mag_auto values.
Arguments:
catalog -- The input SExtractor catalog.
readfile -- True means read the data. False means return the
object without reading the data. The lines from the catalog
are returned as a list of ascii strings c.l. Useful if you want
to do some special parsing of some sort.
preserve_case -- default (False) converts column names to lower case
The input catalog MUST have a header with the SExtractor format:
# 1 ID comment
# 2 ALPHA_J200 another comment
That is, first column is the comment symbol #, second column is
the column number, third column is the column name, and the rest
of the line is a comment. SExtractor allows "vectors" to be identified
only by the first column...e.g.
# 12 FLUX_APER
# 20 FLUXERR_APER
the missing columns are all aperture fluxes through different
apertures. These will be read into attributes:
c.flux_aper # The first one
c.flux_aper_1 # the second one, and so on
The case of aperture radii is a bit nasty, since these only
appear in the SExtractor configuration file. Use parseconfig()
to read that file. |
| |
Methods defined here:
- __init__(self, cfile, readfile=True, preserve_case=False)
- __iter__(self)
- __len__(self)
- buildheader(self)
- Reconstruct the header from the header dictionary.
This might be useful if only a few columns were selected
from the file; otherwise just use the 'header' attribute.
- getcol(self, col, offset=0)
- getcols(self, *args)
- gettypes(self)
- line(self, i)
- Returns an assembled line of this catalog suitable for writing.
Except it doesn't really, if we modified the individual columns...
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class sextractor(se_catalog) |
| |
Read SExtractor catalog...just an alias for se_catalog |
| |
- Method resolution order:
- sextractor
- se_catalog
- __builtin__.object
Methods inherited from se_catalog:
- __init__(self, cfile, readfile=True, preserve_case=False)
- __iter__(self)
- __len__(self)
- buildheader(self)
- Reconstruct the header from the header dictionary.
This might be useful if only a few columns were selected
from the file; otherwise just use the 'header' attribute.
- getcol(self, col, offset=0)
- getcols(self, *args)
- gettypes(self)
- line(self, i)
- Returns an assembled line of this catalog suitable for writing.
Except it doesn't really, if we modified the individual columns...
Data descriptors inherited from se_catalog:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |