Astrometry (pyobs.images.processors.astrometry)
Astrometry
- class Astrometry(**kwargs: Any)
Base class for astrometry processors
AstrometryDotNet
- class AstrometryDotNet(url: str, source_count: int = 50, radius: float = 3.0, timeout: int = 10, exceptions: bool = True, **kwargs: Any)
Perform astrometric solving using an astrometry.net-compatible service.
This processor submits sources extracted from a
pyobs.images.Imageto an astrometry.net service, obtains a WCS solution, and writes it back to the image’s FITS header. The solver endpoint is configured viaurland the request content is built bypyobs.images.processors.astrometry._DotNetRequestBuilder.- Parameters:
url (str) – Base URL of the astrometry.net service endpoint.
source_count (int) – Number of detected sources to include in the request payload. The source selection strategy is defined by
_DotNetRequestBuilder. Default:50.radius (float) – Search radius constraint passed to the request builder. Units and semantics are defined by
_DotNetRequestBuilder(commonly degrees for astrometry.net). Default:3.0.timeout (int) – Timeout in seconds for the network call to the astrometry web service. Default:
10.exceptions (bool) – Whether to raise exceptions on failure. If
True, processing errors are raised (typically aspyobs.images.exceptions.ImageError). IfFalse, errors are handled by marking the image header and returning the original image. Default:True.kwargs – Additional keyword arguments forwarded to
pyobs.images.processors.astrometry.Astrometry.
Behavior
Constructs a request from the input image using
pyobs.images.processors.astrometry._DotNetRequestBuilder(source_count, radius).Logs request metadata via
pyobs.images.processors.astrometry._RequestLogger.Sends the request to the configured service with
request.send(url, timeout).On success, receives solver output and writes the resulting WCS into a copy of the input image using
pyobs.images.processors.astrometry._ResponseImageWriter.Logs the outcome, including WCS information, and returns the result image.
On failure:
If
exceptions=True, raises the underlyingpyobs.images.exceptions.ImageError.If
exceptions=False, setsWCSERR=1in the FITS header, logs a warning, and returns the original image unchanged.
Input/Output
Input:
pyobs.images.ImageOutput:
pyobs.images.Image(copied) with WCS solution written to the FITS header. Pixel data are typically unchanged.
Configuration (YAML)
Minimal local solver:
class: pyobs.images.processors.astrometry.AstrometryDotNet url: "http://localhost:8080/api"
Handle failures without raising exceptions:
class: pyobs.images.processors.astrometry.AstrometryDotNet url: "http://localhost:8080/api" exceptions: false
Notes
The
_DotNetRequestBuilderdetermines how sources are extracted and how the request is formed (including any unit conventions forradius). Consult its documentation for details.WCSERRis used as a failure marker in the FITS header whenexceptions=False.