Skip to content

Database Class

azcam.database

Contains the main azcam database class.

AzcamDatabase

Bases: object

The azcam database class.

abortflag: int = 0 class-attribute instance-attribute

abort flag, 1 (true) if an abort has occurred

cli: dict = {} class-attribute instance-attribute

dict of CLI commands

datafolder: str = '' class-attribute instance-attribute

system datafolder

default_tool = None class-attribute instance-attribute

name of default tool

exposureflags: Dict[str, int] = {'NONE': 0, 'EXPOSING': 1, 'ABORT': 2, 'PAUSE': 3, 'RESUME': 4, 'READ': 5, 'PAUSED': 6, 'READOUT': 7, 'SETUP': 8, 'WRITING': 9, 'GUIDEERROR': 10, 'ERROR': 11} class-attribute instance-attribute

exposure flags

headerorder: list = [] class-attribute instance-attribute

header order in image header

headers: dict = {} class-attribute instance-attribute

header objects

imageparnames: List[str] = ['imageroot', 'imageincludesequencenumber', 'imageautoname', 'imageautoincrementsequencenumber', 'imagetest', 'imagetype', 'imagetitle', 'imageoverwrite', 'imagefolder'] class-attribute instance-attribute

image parameters

logger: AzCamLogger = AzCamLogger() class-attribute instance-attribute

logger object

mode: str = '' class-attribute instance-attribute

operating mode (server or console)

par_table: dict = {'autotitle': 'exposure.auto_title', 'imagetype': 'exposure.image_type', 'exposureflag': 'exposure.exposure_flag', 'exposuresequencedelay': 'exposure.exposure_sequence_delay', 'exposuresequencetotal': 'exposure.exposure_sequence_total', 'exposuresequencenumber': 'exposure.exposure_sequence_number', 'exposuresequenceflush': 'exposure.exposure_sequence_flush', 'exposureupdatingheader': 'exposure.updating_header', 'isexposuresequence': 'exposure.is_exposure_sequence', 'displayimage': 'exposure.display_image', 'sendimage': 'exposure.send_image', 'savefile': 'exposure.save_file', 'flusharray': 'exposure.flush_array', 'tdidelay': 'exposure.tdi_delay', 'tdimode': 'exposure.tdi_mode', 'pardelay': 'exposure.par_delay', 'exposureguidemode': 'exposure.guide_mode', 'exposureguidestatus': 'exposure.guide_status', 'lastfilename': 'exposure.last_filename', 'imagefiletype': 'exposure.filetype', 'imageheaderfile': 'exposure.imageheaderfile', 'imagetest': 'exposure.test_image', 'imagesequencenumber': 'exposure.sequence_number', 'imageautoincrementsequencenumber': 'exposure.auto_increment_sequence_number', 'imageincludesequencenumber': 'exposure.include_sequence_number', 'imageautoname': 'exposure.autoname', 'imageoverwrite': 'exposure.overwrite', 'imageroot': 'exposure.root', 'imagefolder': 'exposure.folder', 'imagesizex': 'exposure.image.focalplane.numcols_image', 'imagesizey': 'exposure.image.focalplane.numrows_image', 'numpiximage': 'exposure.image.focalplane.numpix_image', 'colbin': 'exposure.image.focalplane.col_bin', 'rowbin': 'exposure.image.focalplane.row_bin', 'firstcol': 'exposure.image.focalplane.first_col', 'firstrow': 'exposure.image.focalplane.first_row', 'lastcol': 'exposure.image.focalplane.last_col', 'lastrow': 'exposure.image.focalplane.last_row', 'instrumentenabled': 'instrument.enabled', 'instrumentfocus': 'instrument.focus_position', 'telescopeenabled': 'telescope.enabled', 'telescopefocus': 'telescope.focus_position', 'controltemperature': 'tempcon.control_temperature', 'camtemp': 'tempcon.temperatures[0]', 'dewtemp': 'tempcon.temperatures[1]', 'utilityboardinstalled': 'controller.utility_board_installed', 'pciboardinstalled': 'controller.pci_board_installed', 'timingboardinstalled': 'controller.timing_board_installed', 'videogain': 'controller.video_gain', 'videospeed': 'controller.video_speed', 'usereadlock': 'controller.use_read_lock', 'pcifile': 'controller.pci_file', 'timingfile': 'controller.timing_file', 'utilityfile': 'controller.utility_file', 'timingboard': 'controller.timing_board', 'videoboards': 'controller.video_boards', 'clockboards': 'controller.clock_boards', 'systemname': 'db.systemname', 'abortflag': 'db.abortflag', 'verbosity': 'db.verbosity', 'hostname': 'db.hostname', 'version': 'db.version'} class-attribute instance-attribute

dict of general parameters

parameters: None instance-attribute

parameters object

scripts: dict = {} class-attribute instance-attribute

dict of scripts

system: System instance-attribute

logger object

systemfolder: str = '' class-attribute instance-attribute

system root folder

systemname: str = '' class-attribute instance-attribute

system name

tools: dict = {} class-attribute instance-attribute

dict of tools

verbosity: int = 1 class-attribute instance-attribute

verbosity level for messages

version: str = azcam.__version__ class-attribute instance-attribute

current azcam version

wd: Union[str, None] = None class-attribute instance-attribute

the current working directory

get(name)

Returns a database attribute by name. Args: name: name of attribute to return Returns: value or None if name is not defined

set(name, value)

Sets a database attribute value. Args: name: name of attribute to set value: value of attribute to be set