Image operations (pyobs.modules.image)

Modules for image operations. TODO: write doc

ImageWatcher

class ImageWatcher(watchpath: Optional[str] = None, destinations: Optional[List[str]] = None, **kwargs: Any)

Bases: pyobs.modules.Module

Watch for new images and write them to all given destinations.

Watches a path for new images and stores them in all given destinations. Only if all operations were successful, the file is deleted.

Create a new image watcher.

Parameters:
  • watchpath – Path to watch.

  • destinations – Filename patterns for destinations.

add_image(filename: str) None[source]

Add an image to the image database.

Parameters:

filename (str) – Local filename of new image.

async close() None[source]

Close image watcher.

async open() None[source]

Open module.

ImageWriter

class ImageWriter(filename: str = '/archive/{FNAME}', sources: Optional[Union[str, List[str]]] = None, **kwargs: Any)

Bases: pyobs.modules.Module

Writes new images to disk.

Creates a new image writer.

Parameters:
  • filename – Pattern for filename to store images at.

  • sources – List of sources (e.g. cameras) to process images from or None for all.

async open() None[source]

Open image writer.

async process_new_image_event(event: pyobs.events.Event, sender: str) bool[source]

Puts a new images in the DB with the given ID.

Parameters:
  • event – New image event

  • sender – Who sent the event?

Returns:

Success

Seeing

class Seeing(sources: Optional[Union[str, List[str]]] = None, publisher: Optional[Union[pyobs.utils.publisher.publisher.Publisher, Dict[str, Any]]] = None, max_ellipticity: float = 0.2, correct_for_airmass: bool = True, **kwargs: Any)

Bases: pyobs.modules.Module

Measures seeing on reduced images with a catalog.

Creates a new seeing estimator.

Parameters:
  • sources – List of sources (e.g. cameras) to process images from or None for all.

  • publisher – Publisher to publish results to.

  • max_ellipticity – Maximum ellipticity for sources to consider.

  • correct_for_zenith – Whether to correct seeing for airmass.

async open() None[source]

Open module.

async process_new_image_event(event: pyobs.events.Event, sender: str) bool[source]

Puts a new images in the DB with the given ID.

Parameters:
  • event – New image event

  • sender – Who sent the event?

Returns:

Success