FITS Header Configuration#

Astra automatically generates comprehensive FITS headers for all captured images using metadata from your observatory devices. This system ensures every image contains the scientific metadata required for analysis.

The FITS header system uses a CSV configuration file that maps device properties and observatory parameters to standard FITS keywords. This approach provides flexibility while maintaining consistency across observations.

Configuration File Format#

The CSV configuration file defines how FITS headers are constructed:

  • header: FITS header keyword

  • dtype: Data type (string, integer, float, boolean)

  • fixed: Whether the value is set at the beginning of an imaging sequence (true) or filled later from polling (false)

  • device_type: Source device type or data source

  • device_command: ASCOM command or data source identifier

  • comment: Description of the header keyword

Example Configuration#

Example FITS Header Configuration#

header

dtype

fixed

device_type

device_command

comment

SIMPLE

bool

true

astropy_default

conforms to FITS standard

BITPIX

int

true

astropy_default

array data type

NAXIS

int

true

astropy_default

number of array dimensions

NAXIS1

int

true

astropy_default

# of pixels/row

NAXIS2

int

true

astropy_default

# of rows (also # of scan lines)

EXTEND

bool

true

astra_fixed

1

Extensions may be present

BZERO

float

true

astropy_default

value = fits-value*BSCALE+BZERO

BSCALE

float

true

astropy_default

value = fits-value*BSCALE+BZERO

BUNIT

str

true

astra_fixed

ADU

Physical unit of array values

BLANK

int

true

astra_fixed

-32768

Value used for NULL pixels

ORIGIN

str

true

astra_fixed

ORIGIN

Observatory

TELESCOP

str

true

astra_fixed

TELESCOPE

Telescope Name

INSTRUME

str

true

astra_fixed

INSTRUMEMENT

Instrument used

PI-COI

str

true

astra_fixed

PI-COI

Name of the PI/Co-I

OBSERVER

str

true

astra_fixed

Astra

Name of the observer

OBJECT

str

true

astra

Target as given by the user

RADESYS

str

true

astra_fixed

FK5

Reference system

EQUINOX

float

true

astra_fixed

2000

Catalog equinox of the object coords

DATE

str

false

astra

UTC datetime file written

MJD-OBS

float

false

astra

Modified Julian Date at start of exposure

DATE-OBS

str

false

astra

UTC datetime start of exposure

TIMESYS

str

true

astra_fixed

UTC

Time system used

EXPTIME

float

true

astra

[s] Exposure time

LST

float

false

astra

[s] Local Sidereal Time at start of exposure

HA

str

false

astra

[hms] Hour Angle

UTC

float

false

astra

[s] Coordinated Universal Time at start of exposure

CHECKSUM

str

false

astra

HDU checksum

DATASUM

str

false

astra

Data unit checksum

XBINNING

int

true

Camera

BinX

Binning level along the X-axis

YBINNING

int

true

Camera

BinY

Binning level along the Y-axis

XPIXSZ

float

true

astra

Pixel Width in microns (after binning)

YPIXSZ

float

true

astra

Pixel Height in microns (after binning)

XORGSUBF

int

true

Camera

StartX

Subframe X position in binned pixels

YORGSUBF

int

true

Camera

StartY

Subframe Y position in binned pixels

CAM-SNAM

str

true

Camera

SensorName

Camera sensor name

CAM-STYP

str

true

Camera

SensorType

Camera sensor type

CAM-DNAM

str

true

Camera

Name

Short name of Camera driver

CAM-DVER

str

true

Camera

DriverVersion

Camera driver version

SET-TEMP

float

true

Camera

SetCCDTemperature

[Celsius] CCD temperature setpoint

CCD-TEMP

float

false

Camera

CCDTemperature

[Celsius] CCD temperature at start of exposure

CAM-STAT

int

false

Camera

CameraState

Camera status

FILTER

str

true

astra

Filter name

FW-POS

str

false

FilterWheel

Position

FilterWheel position

FW-NAME

str

true

FilterWheel

Name

FilterWheel name

FW-DVER

str

true

FilterWheel

DriverVersion

FilterWheel driver version

FOCUSPOS

float

false

Focuser

Position

[steps] Focuser position

FOCUSSSZ

float

true

Focuser

StepSize

[micron] Focuser step size

FOCUSTEM

float

false

Focuser

Temperature

[Celsius] Focuser temperature

RA

float

false

Telescope

RightAscension

[deg] Target Right Ascension

DEC

float

false

Telescope

Declination

[deg] Target Declination

APTAREA

float

true

astra

ApertureArea

[m^2] Aperture area of telescope

APTDIA

float

true

astra

ApertureDiameter

[m] Aperture diameter of telescope

FOCALLEN

float

true

astra

FocalLength

[m] Focal length of telescope

ALT-OBS

float

true

Telescope

SiteElevation

[m] Altitude above mean sea level

LAT-OBS

float

true

Telescope

SiteLatitude

[deg +N WGS84] Geodetic latitude

LONG-OBS

float

true

Telescope

SiteLongitude

[deg +E WGS84] Geodetic longitude

ALTITUDE

float

false

Telescope

Altitude

[deg] Telescope altitude in horizontal coordinates

AZIMUTH

float

false

Telescope

Azimuth

[deg] Telescope azimuth in horizontal coordinates

AIRMASS

float

false

astra

Averaged airmass

TEL-DNAM

str

true

Telescope

Name

Short name of Telescope driver

TEL-DVER

str

true

Telescope

DriverVersion

Telescope driver version

TRACKING

bool

false

Telescope

Tracking

Tracking

SLEWING

bool

false

Telescope

Slewing

Slewing

TELPARK

bool

false

Telescope

AtPark

Telescope at park

PIERSIDE

bool

false

Telescope

SideOfPier

ASCOM Telescope side of pier (1 = West 0 = East)

DOMEAZ

float

false

Dome

Azimuth

[deg] Dome azimuth in horizontal coordinates

DOMESTAT

int

false

Dome

ShutterStatus

Dome shutter status

DOM-DNAM

str

true

Dome

Name

Short name of Dome driver

DOMPARK

bool

false

Dome

AtPark

Dome at park

IMAGETYP

str

true

astra

Type of image

DEWPOINT

float

false

ObservingConditions

DewPoint

[Celsius] Dew point

HUMIDITY

float

false

ObservingConditions

Humidity

[%] Ambient atmospheric humidity

AMBTEMP

float

false

ObservingConditions

Temperature

[Celsius] Ambient temperature

WINDSPD

float

false

ObservingConditions

WindSpeed

[m/s] Wind speed

SKYTEMP

float

false

ObservingConditions

SkyTemperature

[Celsius] Sky temperature

SKYLUX

float

false

ObservingConditions

SkyBrightness

[lux] Sky brightness

OBC-DNAM

str

true

ObservingConditions

Name

Short name of ObservingConditions driver

OBC-DVER

str

true

ObservingConditions

DriverVersion

ObservingConditions driver version

SAF-DNAM

str

true

SafetyMonitor

Name

Short name of SafetyMonitor driver

SAF-DVER

str

true

SafetyMonitor

DriverVersion

SafetyMonitor driver version

JD-OBS

float

false

astra

Julian Date at start of exposure

HJD-OBS

float

false

astra

Heliocentric Julian Date at start of exposure

BJD-OBS

float

false

astra

Barycentric Julian Date at start of exposure

JD-END

float

false

astra

Julian Date at end of exposure

MJD-END

float

false

astra

Modified Julian Date at end of exposure

DATE-END

str

false

astra

[ISO 8601] UTC date/time at end of exposure

ASTRA

str

true

astra

Version of Astra

How FITS Headers Are Created#

Astra creates FITS headers in two stages to ensure complete and accurate metadata:

1. Base Headers (at the beginning of an imaging sequence)

When an imaging sequence begins, Astra immediately creates an initial FITS header containing (if fixed=true in the configuration):

  • Observatory information: Site name, coordinates, altitude

  • Optical system: Aperture diameter, area, focal length

  • Instrument details: Camera settings, filter name, pixel scale

  • Observation metadata: Object name, exposure time, image type placeholders

  • Software information: Astra version number

  • Fixed device values: Properties marked as fixed=True in the configuration

TODO: note about IMAGETYP EXPTIME

2. Final Headers (after exposure)

After an imaging sequence, Astra completes any missing header values:

  • Identifies images with incomplete headers

  • Retrieves device polling data from ±10 seconds around each exposure time (stored in a local sqlite database)

  • Interpolates device readings (temperature, pointing, focus position, etc.) to match exposure timestamps

  • Updates FITS files in place while preserving original header structure

  • Adds calculated values such as:

    • Various time scales and reference frames

    • Derived parameters like airmass

This two-stage approach ensures headers contain accurate, time-synchronized metadata, while minimizing time loss between exposures.

Customizing FITS Headers#

You can customize the FITS headers by modifying the CSV configuration file:

  • Adding headers: Add new rows to include additional metadata

  • Removing headers: Delete rows to exclude certain keywords

  • Timing control: Set fixed=True for immediate values, fixed=False for post-exposure interpolated values