# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# #Huntsman Telephoto Array specifications
#
# ##Introduction
#
# The Huntsman Telephoto Array is an astronomical imaging system consisting of 1-10 imaging units attached to a telescope mount.  The concept is closely based on the [Dragonfly Telephoto Array](http://www.dunlap.utoronto.ca/instrumentation/dragonfly/), pictured below.
#
# ![](http://www.dunlap.utoronto.ca/wp-content/uploads/2013/05/Dragonfly_1080px_Oct-2014.jpg)
#
# ###Imaging units
#
# Each imaging unit comprises a [Canon EF 400mm f/2.8L IS II USM camera lens](http://www.canon.com.au/en-AU/EOS-Professional/Product-Range/Lenses/EF-Super-Telephoto/EF400mm-f28L-IS-II-USM-Lens), an [SBIG STF-8300M ccd camera](https://www.sbig.com/products/cameras/stf-series/stf/stf-8300m/) and an adaptor from [Birger Engineering](birger).  The prototype imaging unit ('the Huntsman Eye') is shown below.  The tripod adaptor bracket is bolted to the main lens body, this bracket could be removed and the bolt holes used for direct attachment to a support structure.
#
# ![](https://scontent-nrt1-1.xx.fbcdn.net/hphotos-xaf1/t31.0-8/10548205_670322309702850_4884215092166711965_o.jpg)
#
# ###Telescope mount
#
# The Huntsman Telephoto Array will use a [Software Bisque Paramount ME II telescope mount](http://www.bisque.com/sc/pages/ParamountMEII.aspx).  A [Solidworks eDrawing](http://www.bisque.com/sc/media/p/66949.aspx) is available as part of the [mount documentation set](http://www.bisque.com/sc/media/g/pmeiidocs/default.aspx).
#
# ![](http://www.bisque.com/help/paramountme/me_ii_render_3.jpg)
#
# ###Support structure
#
# The Huntsman Telephoto Array support structure must enable the imaging units to be assembled into an array and attached to the telescope mount.  The Dragonfly Telephoto Array has adopted a modular solution based on tubular structures around each lens, as can be seen in the photo below.
#
# ![](http://news.yale.edu/sites/default/files/imce/stars-two.jpg)
#
# ### Enclosure
#
# The Huntsman Telephoto Array is expected to be housed in an [Astro Dome 4500](http://www.astrodomes.com/adome4500.php), a 4.5 metre diameter telescope dome with a 1.2 metre wide aperture.  A 21 year old example at Mt Kent Observatory is shown below.
#
# ![](http://drhotdog.smugmug.com/photos/i-PdCsXsv/0/L/i-PdCsXsv-L.jpg)

# ## Science requirements

# ### Spatial sampling
#
# Derived from the specifications of the chosen hardware.

# +
import math
from astropy import units as u

pixel_pitch = 5.4 * u.micron / u.pixel # STF-8300M pixel pitch 
focal_length = 400 * u.millimeter # Canon EF 400 mm f/2.8L IS II USM focal length 
resolution = (3326, 2504) * u.pixel # STF-8300M resolution in pixels, (x, y)

sampling = (pixel_pitch / focal_length).to(u.radian/u.pixel, equivalencies = u.equivalencies.dimensionless_angles())
sampling.to(u.arcsec/u.pixel)
# -

# * **Each imaging unit shall deliver an on-sky spatial sampling of $2.8\pm 0.1'' /$ pixel**

# ### Field of view
#
# Derived from the specifications of the chosen hardware.

fov = resolution * sampling
fov.to(u.degree)

# * **Each imaging unit shall deliver an instantaneous field of view of $2.6 \pm 0.1 \times 1.9 \pm 0.1$ degrees** 

# ### Exposure time
#
# Individual exposure times of 5-30 minutes are anticipated (5-10 minutes for broadband observations, 30 minutes for narrowband).

exposure_times = ((5, 10, 30) * u.minute)
exposure_times

# * **The system shall meet all requirements with exposure times of up to 30 minutes**

# ### Number of imaging units
#
# The maximum number of imaging units per telescope mount is really determined by the mount payload mass limit and the aperture size of the enclosure.  The Dragonfly Telephoto Array are currently operating with 10 imaging units on a single mount, the Huntsman Telephoto Array should be capable of at least matching this.

n_units = (1, 4, 10)
n_units

# * **The system shall support up to at least 10 imaging units per telescope mount**

# ###Imaging unit alignment
#
# Given the large field of view tight coalignment of individual imaging units is not required, or even particularly desirable.

coalignment_tolerance = 5 * u.arcminute
coalignment_tolerance

# * **All imaging units should point in the same direction to within a tolerance of 5 arcminutes radius on sky (TBC)**
#
# All data will be resampled prior to combination so some relative rotation between imaging units is acceptable.

north_alignment_tolerance = 2.5 * u.degree
north_alignment_tolerance

# * **All imaging units shall have the camera y axis aligned with the North-South axis to within a tolerance of $\pm$2.5 degrees (TBC)** 

# ###Image quality
#
# [Abraham & <NAME> (2014)](http://arxiv.org/abs/1401.5473) report that imaging units of the design proposed for the Huntsman Telephoto Array are capable of producing a point spread function (PSF) with full width at half maximum (FWHM) of $\sim1.5''$, as measured by (undersampled) 3rd order polynomial fitting by SExtractor.  When image sensor tilts (PSF degradation $<0.4''$) and imperfect telescope tracking are taken into account average FWHM of $< 2''$ were still achieved across the entire field of view.  The Huntsman Telephoto Array should at least match this.

central_fwhm = 1.5 * u.arcsecond
tilt_fwhm_degradation = 0.4 * u.arcsecond
max_fwhm = 2 * u.arcsecond
max_fwhm

# * **The system shall deliver a PSF with average FWHM $< 2''$ over the full field of view, as measured using a 3rd order polynomial fit performed wth the SExtrator software**

# ###Filters
#
# For the primary science project we anticipate using SDSS-type g & r bandpass filters, typically with half of the imaging units equipped with one and half with the other though there may be targets for which we would want to use a different mix of filters.  During bright of Moon it will not be possible to make useful observations for the primary science project and so during these times we may use narrowband filters, e.g. H-$\alpha$.  To do this it must be possible to change filters between nights but it is not necessary that this be a motorised/automated process.
#
# * **Each imaging unit shall be equipped with an optical bandpass filter**  
# * **It must be possible to change filters between nights**
# * **The set of filters shall contain at least one SDSS-type filter of either g or r band for each imaging unit**

# ### Sky coverage
#
# The system should allow the observation of targets at any position on the sky that corresponds to a reasonable airmass, i.e. $<2$.

max_zenith_distance = 60 * u.degree
max_zenith_distance

# * **The system shall satisfy all functional requirements (e.g. image quality, alignment) while observing any sky position with a zenith distance less than 60 degrees. The system is not required to meet functional requirements if observing a sky position with a zenith distance of greater than 60 degrees**

# ## Mechanical requirements

# ### Support structure(s)
#
# * **The mechanical support structure(s) shall allow the number of imaging units specified in the science requirements to be attached to the telescope mount**

n_units

# ### Imaging unit interface
#
# * **The support structure(s) shall attach to the imaging units via the Canon EF 400mm f/2.8L IS II USM camera lens tripod mount bolt hole pattern and/or clamping of the camera lens body**

# ### Telescope mount interface
#
# * **The support structure(s) shall attach to the telescope mount via the standard interface plate, the Paramount ME II Versa-Plate (drawing [here](http://www.bisque.com/sc/media/p/75171.aspx))**

# ### Alignment
#
# * **The support structure(s) shall ensure that the imaging units are aligned to within the tolerances specified in the science requirements**

coalignment_tolerance

north_alignment_tolerance

# ### Flexure
#
# The support structure(s) must be rigid enough so that flexure will not prevent the system from achieving the image quality specification from the science requirements.  This requires the pointing of all imaging units to remain constant relative to either the telescope mount axes (if not autoguiding) or the autoguider pointing (if using autoguiding) to within a set tolerance for the duration of any individual exposure.
#
# The tolerance can be calculated from the delivered image quality specification and expected imaging unit image quality.

fwhm_to_rms = (2 * (2 * math.log(2))**0.5)**-1
max_flexure_rms = fwhm_to_rms * (max_fwhm**2 - (central_fwhm + tilt_fwhm_degradation)**2)**0.5
max_flexure_rms

# A given exposure time corresponds to an angle of rotation about the telescope mount hour angle axis.

ha_angles = (exposure_times.to(u.hour) * (u.hourangle / u.hour)).to(u.degree)
ha_angles

# * **The support structure(s) shall ensure that the pointing of all imaging units shall remain fixed relative to the telescope mount axes to within 0.27 arcseconds rms while the hour angle axis rotates through any 7.5 degree angle, for any position of the declination axis, within the sky coverage requirement's zenith distance range**

max_zenith_distance

# ###  Mass
#
# The telescope mount is rated for a maximum payload (not including counterweights) of 109 kg, therefore the total mass of imaging units plus support structure(s) should not exceed this value.  The mass of the lens is 4.1 kg (source [here](http://www.the-digital-picture.com/Reviews/Lens-Specifications.aspx?Lens=741&LensComp=0&Units=M)), the mass of the CCD camera is 0.8 kg (source [here](https://www.sbig.com/products/cameras/stf-series/stf/stf-8300m/)) and the mass of the adaptor is estimated to be no more than 0.2 kg.

# +
lens_mass = 4.1 * u.kilogram
camera_mass = 0.8 * u.kilogram
adaptor_mass = 0.2 * u.kilogram
imaging_unit_mass = lens_mass + camera_mass + adaptor_mass

max_payload_mass = 109 * u.kilogram

max_struture_mass = max_payload_mass - max(n_units) * imaging_unit_mass
max_struture_mass
# -

# * **The total mass of all support structure(s) shall be less than 58 kg**

# ### Footprint
#
# The support structure(s) needs to position the imaging units such that their combined beam footprint will pass through the dome aperture without vignetting.  Translating this requirement into an allowed space envelope for the imaging units is not straightforward as the geometry is complicated: the axes of the telescope mount will be offset from each other, from the geometric centre of the dome and from the centre of the imaging unit array.  3D modelling of the mount, imaging unit array and enclosure will be required to verify this for all sky positions however as a general principle the imaging units should be as closely packed as possible to minimise the overall size of their combined beam footprint.

# ## Environmental
#
# The system is intended to be placed at a moderate altitude site in mainland Australia.  The expected ranges of environmental conditions during operation and storage are as follows.



StarcoderdataJupyterScriptsDedupFiltered