SourceList¶
-
class
mpdaf.sdetect.
SourceList
[source]¶ Bases:
list
Handles a list of
mpdaf.sdetect.Source
objects.Methods Summary
append
L.append(object) – append object to end count
(...)extend
L.extend(iterable) – extend list by appending elements from the iterable from_path
(path)Read a SourceList object from the path of a directory containing source files. index
((value, [start, ...)Raises ValueError if the value is not present. insert
L.insert(index, object) – insert object before index pop
(...)Raises IndexError if list is empty or index is out of range. remove
L.remove(value) – remove first occurrence of value. reverse
L.reverse() – reverse IN PLACE sort
L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; write
(name[, path, overwrite, fmt])Create the directory and saves all sources files and the catalog file in this folder. Methods Documentation
-
append
()¶ L.append(object) – append object to end
-
count
(value) → integer -- return number of occurrences of value¶
-
extend
()¶ L.extend(iterable) – extend list by appending elements from the iterable
-
classmethod
from_path
(path)[source]¶ Read a SourceList object from the path of a directory containing source files.
Parameters: path : str
Directory containing Source files
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
insert
()¶ L.insert(index, object) – insert object before index
-
pop
([index]) → item -- remove and return item at index (default last).¶ Raises IndexError if list is empty or index is out of range.
-
remove
()¶ L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.
-
reverse
()¶ L.reverse() – reverse IN PLACE
-
sort
()¶ L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1
-
write
(name, path='.', overwrite=True, fmt='default')[source]¶ Create the directory and saves all sources files and the catalog file in this folder.
path/name.fits
: catalog file (In FITS table, the maximum number of fields is 999. In this case, the catalog is saved as an ascci table).path/name/nameNNNN.fits
: source file (NNNN corresponds to the ID of the source)Parameters: name : str
Name of the catalog
path : str
path where the catalog will be saved.
overwrite : bool
Overwrite the catalog if it already exists
fmt : str, ‘working’ or ‘default’
Format of the catalog. The format differs for the LINES table.
-