Commit e0e263b6 authored by karpov-sv's avatar karpov-sv
Browse files

A note about coordinate origin added

parent 509bf12b
......@@ -22,6 +22,10 @@ Both routines return the results as a standard Astropy Table, ordered by the obj
For :func:`~stdpipe.photometry.get_objects_sextractor`, the output may also contain columns related to PSF photometry (`x_psf`, `y_psf`, `flux_psf`, `fluxerr_psf`, `mag_psf`, `magerr_psf`, `chi2_psf`, `spread_model`, `spreaderr_model`), as well as any additional measuremet parameter requested through `extra_params` argument.
.. attention::
*STDPipe* (as well as SEP library) uses pixel coordinate convention with `(0, 0)` as the origin - that differs from *SExtractor* that uses `(1, 1)` as origin of coordinates! So the routine transparently converts `x` and `y` (as well as `x_psf` and `y_psf`) in the output from *SExtractor* to proper origin, so that the coordinates of objects detected by both routines are in the same system. However, if you manually add some pixel coordinate parameter to the output through `extra_params` argument, they will not be appropriately adjusted!
Below are some examples of object detection.
.. code-block:: python
......@@ -72,9 +76,9 @@ Finally, using SExtractor star/galaxy separators - `CLASS_STAR` and `SPREAD_MODE
print('SPREAD_MODEL = %.3f +/- %.3f, CLASS_STAR = %.2f' %
(cand['spread_model'], cand['spreaderr_model'], cand['CLASS_STAR']))
.. attention::
The most important problem with object detection using these routines is handling of blended objects, as the codes we are using can't properly deblend close groups, except for simplest cases.
.. note::
The most important problem with object detection using these routines is handling of blended objects, as the codes we are using can't properly deblend close groups, except for simplest cases.
.. autofunction:: stdpipe.photometry.get_objects_sextractor
:noindex:
......
......@@ -64,6 +64,9 @@ Design principles:
- everything operates on temporary files, nothing is kept after the run unless explicitly asked for
- temporary files are created in unique temporary directories for each run, so several instances of routines may be safely run in parallel
- All image (pixel) coordinates have origin at `(0, 0)` - the ones returned from and passed to e.g. *SExtractor*, *SCAMP* and likes (that are based on `(1, 1)` origin) are transparently converted
Common conventions for routine arguments:
- Most of functions accept `verbose` argument that controls the amount of informational outputs the function produces. You may use `verbose=True` to see the details of what exactly the function is doing. Also, you may pass any `print`-like function to this argument to receive the messages instead of printing - so e.g. they may be logged.
......
......@@ -205,7 +205,7 @@ def get_objects_sextractor(image, header=None, mask=None, err=None, thresh=2.0,
:param mask: Image mask as a boolean array (True values will be masked), optional
:param err: Image noise map as a NumPy array, optional
:param thresh: Detection threshold, in sigmas above local background, to be used for `DETECT_THRESH` parameter of SExtractor call
:param aper: Circular aperture radius in pixels, to be used for flux measurement
:param aper: Circular aperture radius in pixels, to be used for flux measurement. May also be list - then flux will be measured for all apertures from that list.
:param r0: Smoothing kernel size (sigma) to be used for improving object detection
:param gain: Image gain, e/ADU
:param edge: Reject all detected objects closer to image edge than this parameter
......@@ -416,6 +416,10 @@ def get_objects_sextractor(image, header=None, mask=None, err=None, thresh=2.0,
obj['x'] -= 1
obj['y'] -= 1
if 'x_psf' in obj:
obj['x_psf'] -= 1
obj['y_psf'] -= 1
obj.meta['aper'] = aper
if sort:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment