# Definition of the community standard for skyglow observations 1.0
# URL: http://www.darksky.org/NSBM/sdf1.0.pdf
# Number of header lines: 35
# This data is released under the following license: ODbL 1.0 http://opendatacommons.org/licenses/odbl/summary/
# Device type: {{ instrument.model }}
# Instrument ID: {{ instrument.name }}
# Data supplier: {{ observer.name }} / {{ observer.organization }}
# Location name: {{ location.place }} / {{ location.town }} / {{ location.sub_region }} / {{ location.region }} / {{ location.country }} 
# Position: {{ location.latitude }}, {{ location.longitude }}, {{ location.elevation | default('') }}
# Local timezone: {{ location.timezone }}
# Time Synchronization: timestamp added by MQTT subscriber
# Moving / Stationary position: STATIONARY
# Moving / Fixed look direction: FIXED
# Number of channels: {{ instrument.nchannels }}
{% if instrument.filter.changed -%}
# Filters per channel: {{ instrument.filter.current.value }} (from {{ instrument.filter.current.valid_since }})
{% else -%}
# Filters per channel: {{ instrument.filter.current.value }}
{% endif -%}
# Measurement direction per channel: {{ instrument.az_alt }}
# Field of view: {{ instrument.fov }}
# Number of fields per line: {{ instrument.columns }}
{% if instrument.mac_address.changed -%}
# TESS MAC address: {{ instrument.mac_address.current.value }} (from {{ instrument.mac_address.current.valid_since }})
{% else -%}
# TESS MAC address: {{ instrument.mac_address.current.value }}
{% endif -%}
# TESS firmware version: {{ instrument.firmware }}
# TESS cover offset value: {{ instrument.cover_offset }}
# TESS zero point: {{ instrument.zero_point.current.value }}
{% if instrument.zero_point.current.value == 20.50 -%}
# Comment: This photometer may not have been calibrated (Zero Point = 20.50)
{% else -%}
# Comment:  
{% endif -%}
{% if instrument.mac_address.changed -%}
# Comment: MAC address was {{ instrument.mac_address.previous.value }} until {{ instrument.mac_address.previous.valid_until }}
{% else -%}
# Comment:
{% endif -%}
{% if instrument.mac_address.changed and instrument.zero_point.changed -%}
# Comment: Previous Zero Point was {{ instrument.zero_point.previous.value }} due to MAC address change
{% elif not instrument.mac_address.changed and instrument.zero_point.changed -%}
# Comment: Current Zero Point valid since {{ instrument.zero_point.current.valid_since }}, Previous Zero Point ({{ instrument.zero_point.previous.value }}) only valid until {{ instrument.zero_point.previous.valid_until }}
{% else -%}
# Comment:
{% endif -%}
{% if instrument.filter.changed -%}
# Comment: Previous filter was {{ instrument.filter.previous.value }} (until {{ instrument.filter.previous.valid_until }})
{% else -%}
# Comment:
{% endif -%}
# Comment:
{% if instrument.model == 'TESS-W' -%}
# Comment: 
{% else -%}
# Comment: Current Zero Point in the header corresponds to the UV/IR-cut channel
{% endif -%}
# Comment: MSAS = ZP - 2.5*log10(Frequency)
# blank line 30
# blank line 31
# blank line 32
{% if instrument.model == 'TESS-W' -%}
# UTC Date & Time, Local Date & Time, Enclosure Temperature, Sky Temperature, Frequency, MSAS, ZP, Sequence Number
# YYYY-MM-DDTHH:mm:ss.fff;YYYY-MM-DDTHH:mm:ss.fff;Celsius;Celsius;Hz;mag/arcsec^2;mag/arcsec^2; Multiple of Tx period
{% else -%}
# UTC Date & Time, Local Date & Time, Enclosure Temperature, Sky Temperature, Freq1, MSAS1, ZP1, Freq2, MSAS2, ZP2, Freq3,  MSAS3, ZP3, Freq4, MSAS4, ZP4, Sequence Number
# YYYY-MM-DDTHH:mm:ss.fff;YYYY-MM-DDTHH:mm:ss.fff;Celsius;Celsius;Hz;mag/arcsec^2;mag/arcsec^2;Hz;mag/arcsec^2;mag/arcsec^2;Hz;mag/arcsec^2;mag/arcsec^2;Hz;mag/arcsec^2;mag/arcsec^2; Multiple of Tx period
{% endif -%}
# END OF HEADER
