Settings

class astrometry_net_client.settings.Setting(name, type, verify_func, verify_mesg)
name: str

Alias for field number 0

type: Callable

Alias for field number 1

verify_func: Optional[Callable]

Alias for field number 2

verify_mesg: Optional[str]

Alias for field number 3

class astrometry_net_client.settings.Settings(dict=None, /, **kwargs)

Enhanced dictionary which stores the parameters which can be given alongside a request (mainly upload requests like astrometry_net_client.upload.UploadFile)

The settings can either be accessed (retrieved or set) using the normal dictionary notation, or the dot notation (see example). If an invalid setting is given (e.g. not a known setting, value of the setting has an incompatible type or the value does not satisfy the checking function)

Some convenience functions are provided for easy setting of the plate scale.

Example

>>> from astrometry_net_client.settings import Settings
>>> settings = Settings(parity=2)
>>> settings.image_width = 1000
>>> settings["image_height"] = 2000
>>> settings.update({"publicly_visible": "y", "use_sextractor": True})
>>> settings
{
    "publicly_visible": "y",
    "use_sextractor": True,
    "parity": 2,
    "image_width": 1000,
    "image_height": 2000,
}
>>> # Modification of the settings object
>>> del settings["parity"]
>>> settings.use_sextractor = False
>>> settings["publicly_visible"] = "n"
>>> settings.update({"image_height": 500, "image_width": 1000})
>>> settings
{
    "publicly_visible": "n",
    "use_sextractor": False,
    "image_width": 1000,
    "image_height": 500,
}
set_scale_estimate(estimate, error, unit='arcminwidth')

Specify the size of your field using an estimate + a deviation (error)

Sets the size of your field by an estimate + error pair. Will result in a range of (estimate - error, estimate + error).

Incompatible with set_scale_range()

Parameters
  • estimate (float) – The estimate center value for your field size.

  • error (float) – The range around your estimate value.

  • unit (str) – Optional argument which determines the unit of the upper / lower values. Defaults to 'arcminwidth'. Can be one of: 'arcminwidth', 'arcsecperpix' or 'degwidth'.

Examples

>>> settings = Settings()
>>> settings.set_scale_estimate(15, 5)
>>> settings
{'scale_est': 15, 'scale_err': 5, 'scale_units': 'arcminwidth',
        'scale_type': 'ev'}
set_scale_range(lower, upper, unit='arcminwidth')

Specify the size of your field using a range.

Set the upper and lower limits for the field size of your upload. The unit is defined by the unit parameter, which defaults to 'arcminwidth'.

Incompatible with set_scale_estimate()

Parameters
  • lower (float) – Number which defines the lowest value for your field size.

  • upper (float) – Number which defines the highest value for your field size.

  • unit (str) – Optional argument which determines the unit of the upper / lower values. Defaults to 'arcminwidth'. Can be one of: 'arcminwidth', 'arcsecperpix' or 'degwidth'.

Examples

>>> settings = Settings()
>>> settings.set_scale_range(5, 25)
>>> settings
{'scale_lower': 5, 'scale_upper': 25, 'scale_units': 'arcminwidth',
        'scale_type': 'ul'}