Sky flats (pyobs.utils.skyflats)

TODO: write docs

FlatFielder

class FlatFielder(functions: Union[str, Dict[str, Union[str, Dict[str, str]]]], target_count: float = 30000, min_exptime: float = 0.5, max_exptime: float = 5, test_frame: Optional[Tuple[float, float, float, float]] = None, counts_frame: Optional[Tuple[float, float, float, float]] = None, allowed_offset_frac: float = 0.2, min_counts: int = 100, pointing: Optional[Union[Dict[str, Any], SkyFlatsBasePointing]] = None, callback: Optional[Callable[[...], Coroutine[Any, Any, None]]] = None, **kwargs: Any)

Automatized flat-fielding.

Initialize a new flat fielder.

Parameters:
  • functions – Function f(h) for each filter to describe ideal exposure time as a function of solar elevation h, i.e. something like exp(-0.9*(h+3.9)). See ExpTimeEval for details.

  • target_count – Count rate to aim for.

  • min_exptime – Minimum exposure time.

  • max_exptime – Maximum exposure time.

  • test_frame – Tupel (left, top, width, height) in percent that describe the frame for on-sky testing.

  • counts_frame – Tupel (left, top, width, height) in percent that describe the frame for calculating mean count rate.

  • allowed_offset_frac – Offset from target_count (given in fraction of it) that’s still allowed for good flat-field

  • min_counts – Minimum counts in frames.

  • observer – Observer to use.

  • vfs – VFS to use.

  • callback – Callback function for statistics.

Scheduler

class Scheduler(functions: Union[str, Dict[str, Union[str, Dict[str, str]]]], priorities: SkyflatPriorities, observer: Observer, min_exptime: float = 0.5, max_exptime: float = 5, timespan: float = 7200, filter_change: float = 30, count: int = 20, readout: Optional[Dict[str, float]] = None)

Scheduler for taking flat fields

Initializes a new scheduler for taking flat fields

Parameters:
  • functions – Flat field functions

  • priorities – Class handling priorities

  • observer – Observer to use

  • min_exptime – Minimum exposure time for flats

  • max_exptime – Maximum exposure time for flats

  • timespan – Timespan from now that should be scheduled [s]

  • filter_change – Time required for filter change [s]

  • count – Number of flats to schedule

  • readout – Dictionary with readout times (in sec) per binning (as BxB).

Sky flat pointings (pyobs.utils.skyflats.pointing)

TODO: write docs

SkyFlatsBasePointing

class SkyFlatsBasePointing(vfs: Optional[Union['VirtualFileSystem', Dict[str, Any]]] = None, comm: Optional[Union[Comm, Dict[str, Any]]] = None, timezone: Union[str, datetime.tzinfo] = 'utc', location: Optional[Union[str, Dict[str, Any], EarthLocation]] = None, observer: Optional[Observer] = None, **kwargs: Any)

Base class for flat poinings.

Note

Objects must always be opened and closed using open() and close(), respectively.

This class provides a VirtualFileSystem, a timezone and a location. From the latter two, an observer object is automatically created.

Object also adds support for easily adding threads using the add_background_task() method as well as a watchdog thread that automatically restarts threads, if requested.

Using add_child_object(), other objects can be (created an) attached to this object, which then automatically handles calls to open() and close() on those objects.

Parameters:
  • vfs – VFS to use (either object or config)

  • comm – Comm object to use

  • timezone – Timezone at observatory.

  • location – Location of observatory, either a name or a dict containing latitude, longitude, and elevation.

SkyFlatsStaticPointing

class SkyFlatsStaticPointing(initialized: bool = False, *args: Any, **kwargs: Any)

Static flat pointing.

Inits new static pointing for sky flats.

Parameters:

initialized – If False, telescope does not move at all.

Sky flat priorities (pyobs.utils.skyflats.priorities)

TODO: write docs

ArchiveSkyflatPriorities

class ArchiveSkyflatPriorities(archive: Union[Dict[str, Any], Archive], site: str, instrument: str, filter_names: List[str], binnings: List[int], *args, **kwargs)

Calculate flat priorities from an archive.

ConstSkyflatPriorities

class ConstSkyflatPriorities(priorities: Dict[Tuple[str, Tuple[int, int]], float], *args: Any, **kwargs: Any)

Constant flat priorities.

SkyflatPriorities

class SkyflatPriorities

Base class for sky flat priorities.