Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions SEImplementation/python/sourcextractor/config/argv.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class Arguments(object):
key1 = 32.
key2 = float

For the first case - a value -, if no value is passed via sys.argv, this will be the default. Otherwise,
For the first case--a value--if no value is passed via sys.argv, this will be the default. Otherwise,
its type (float) will be used to cast the received value.

For the second case - a type -, if no value is passed via sys.argv, the parameter will default to None.
For the second case--a type -, if no value is passed via sys.argv, the parameter will default to None.
Otherwise, the type will be used to cast the received value.

Callables are also accepted. They should accept to be called with no parameters, returning the default,
or with a single string, returning the parsed value.

Values can be accessed later as attributes:

instance.key1 and instance.key2
``instance.key1`` and ``instance.key2``

Raises
------
Expand Down Expand Up @@ -128,15 +128,15 @@ def __repr__(self):
class FileList(object):
"""
Helper class for receiving a globing pattern as a parameter, defining a list of files
- i.e. measurement images or PSFs.
--i.e. measurement images or PSFs.
It is an iterable, and can be passed directly to load_fits_images.

Parameters
----------
value : str
A file globing expression. i.e "*.psf", "band_[r|i|g]_*.fits" or similar.
The result is always stored and returned in alphabetical order, so the order between two
file lists - i.e frame image and PSF - is consistent and a matching can be done easily between them.
file lists--i.e frame image and PSF--is consistent and a matching can be done easily between them.

See Also
--------
Expand Down
17 changes: 9 additions & 8 deletions SEImplementation/python/sourcextractor/config/model_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ class ModelBase(cpp.Id):
"""
Base class for all models.
"""

def get_params(self):
return []

Expand All @@ -449,7 +449,7 @@ def __init__(self, x_coord, y_coord, flux):
self.x_coord = x_coord if isinstance(x_coord, ParameterBase) else ConstantParameter(x_coord)
self.y_coord = y_coord if isinstance(y_coord, ParameterBase) else ConstantParameter(y_coord)
self.flux = flux if isinstance(flux, ParameterBase) else ConstantParameter(flux)

def get_params(self):
return [self.x_coord, self.y_coord, self.flux]

Expand Down Expand Up @@ -530,7 +530,7 @@ def to_string(self, show_params=False):
return 'ConstantModel[value={}]'.format(self.value)
else:
return 'ConstantModel[value={}]'.format(self.value.id)

def get_params(self):
return [self.value]

Expand Down Expand Up @@ -826,6 +826,7 @@ def __init__(self, ra, dec):
def pixel_to_world_coordinate(x, y):
"""
Transform an (X, Y) in pixel coordinates on the detection image to (RA, DEC) in world coordinates.

Parameters
----------
x : float
Expand Down Expand Up @@ -1229,28 +1230,28 @@ def set_meta_iteration_stop(self, meta_iteration_stop):

"""
self.params_dict["meta_iteration_stop"] = meta_iteration_stop

def set_window_type(self, window_type):
"""
Parameters
----------

window_type : WindowType
specify the type of model fitting window

"""
if type(window_type) != WindowType:
raise TypeError("Window type must be a WindowType enum value!")

self.params_dict["window_type"] = window_type

def set_ellipse_scale(self, ellipse_scale):
"""
Parameters
----------

ellipse_scale : double
specify scaling of elliptic footprints
specify scaling of elliptic footprints

"""
self.params_dict["ellipse_scale"] = ellipse_scale
Expand Down
8 changes: 4 additions & 4 deletions doc/src/Background.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Modeling the background
On linear detectors, the value measured at each pixel is the sum of a "background" signal and light coming from the sources of interest.
To be able to detect the faintest objects and make accurate measurements, |SourceXtractor++| needs first computing a precise estimate of the background level at any position of the image: a *background map*.
Strictly speaking, there should be one background map per source, that is, what would the image look like if that very source was missing.
However, one can start by assuming that most discrete sources do not overlap too severely — which is generally the case for high galactic latitude fields, and that the background varies smoothly across the field. |SourceXtractor++|'s current background model is essentially the same as that of |SExtractor|_ :cite:`1996AAS_117_393B`.
However, one can start by assuming that most discrete sources do not overlap too severely — which is generally the case for high galactic latitude fields, and that the background varies smoothly across the field. |SourceXtractor++|'s current background model is essentially the same as that of |SExtractor|_ :cite:`1996AAS_117_393B`.

Background estimation
---------------------
Expand All @@ -32,7 +32,7 @@ Using simulated images, the expression above was found more accurate with clippe

\mbox{Mode} = 3 \times \mbox{Median} - 2 \times \mbox{Mean}.

:numref:`fig_modevsmean` shows that the mode estimation in :eq:`sexbackmode` is considerably less affected by source crowding than a simple clipped mean :cite:`1981AJ_86_476J,1987AA_183_177I` but it is :math:`\approx 30\%` noisier.
:numref:`fig_modevsmean` shows that the mode estimation in :eq:`sexbackmode` is considerably less affected by source crowding than a simple clipped mean :cite:`1981AJ_86_476J,1987AA_183_177I` but it is :math:`\approx 30\%` noisier.
Obviously :eq:`sexbackmode` is not valid for any distribution; |SourceXtractor++| falls back to a simple median for estimating the local background value if the mode and the median disagree by more than 30%.

.. _fig_modevsmean:
Expand All @@ -43,7 +43,7 @@ Obviously :eq:`sexbackmode` is not valid for any distribution; |SourceXtractor++

Simulations of 32×32 pixels background cells contamined by random Gaussian profiles.
The true background lies at 0 ADUs.
While being a bit noisier, the clipped "mode" gives a more robust estimate than the clipped mean in crowded regions.
While being a bit noisier, the clipped "mode" gives a more robust estimate than the clipped mean in crowded regions.

.. _chap_backfilter:

Expand Down Expand Up @@ -75,7 +75,7 @@ The user has some control over background map filtering by specifying the size o
The ``smoothing-box-size`` configuration parameter sets the box size in pixels.
``smoothing-box-size=3`` is the default and is sufficient in most cases.
``smoothing-box-size=1`` deactivates filtering.
Larger dimensions may occasionally be used to compensate for small background cell sizes, or in the presence of large image artifacts.
Larger dimensions may occasionally be used to compensate for small background cell sizes, or in the presence of large image artifacts.

By default, the computed background maps are automatically subtracted from input images.
However there are situations where subtracting a *constant* from the detection image may be more relevant, e.g., for images with strongly non-Gaussian background noise |pdf|_\ s).
Expand Down
Loading