<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 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, pictured below.
Imaging units
Each imaging unit comprises a Canon EF 400mm f/2.8L IS II USM camera lens, an SBIG STF-8300M ccd camera and an adaptor from Birger Engineering.  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.
Telescope mount
The Huntsman Telephoto Array will use a Software Bisque Paramount ME II telescope mount.  A Solidworks eDrawing is available as part of the mount documentation set.
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.
Enclosure
The Huntsman Telephoto Array is expected to be housed in an Astro Dome 4500, 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.
Science requirements
Spatial sampling
Derived from the specifications of the chosen hardware.
Step1:  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.
Step2:  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).
Step3:  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.
Step4:  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.
Step5:  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.
Step6:  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 & van Dokkum (2014) 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.
Step7:  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$.
Step8:  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
Step9:  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)
Alignment
The support structure(s) shall ensure that the imaging units are aligned to within the tolerances specified in the science requirements
Step10:  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.
Step11:  A given exposure time corresponds to an angle of rotation about the telescope mount hour angle axis.
Step12:  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
Step13:  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), the mass of the CCD camera is 0.8 kg (source here) and the mass of the adaptor is estimated to be no more than 0.2 kg.
<ASSISTANT_TASK:>
Python Code:
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)
Explanation: 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, pictured below.
Imaging units
Each imaging unit comprises a Canon EF 400mm f/2.8L IS II USM camera lens, an SBIG STF-8300M ccd camera and an adaptor from Birger Engineering.  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.
Telescope mount
The Huntsman Telephoto Array will use a Software Bisque Paramount ME II telescope mount.  A Solidworks eDrawing is available as part of the mount documentation set.
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.
Enclosure
The Huntsman Telephoto Array is expected to be housed in an Astro Dome 4500, 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.
Science requirements
Spatial sampling
Derived from the specifications of the chosen hardware.
End of explanation
fov = resolution * sampling
fov.to(u.degree)
Explanation: 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.
End of explanation
exposure_times = ((5, 10, 30) * u.minute)
exposure_times
Explanation: 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).
End of explanation
n_units = (1, 4, 10)
n_units
Explanation: 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.
End of explanation
coalignment_tolerance = 5 * u.arcminute
coalignment_tolerance
Explanation: 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.
End of explanation
north_alignment_tolerance = 2.5 * u.degree
north_alignment_tolerance
Explanation: 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.
End of explanation
central_fwhm = 1.5 * u.arcsecond
tilt_fwhm_degradation = 0.4 * u.arcsecond
max_fwhm = 2 * u.arcsecond
max_fwhm
Explanation: 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 & van Dokkum (2014) 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.
End of explanation
max_zenith_distance = 60 * u.degree
max_zenith_distance
Explanation: 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$.
End of explanation
n_units
Explanation: 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
End of explanation
coalignment_tolerance
north_alignment_tolerance
Explanation: 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)
Alignment
The support structure(s) shall ensure that the imaging units are aligned to within the tolerances specified in the science requirements
End of explanation
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
Explanation: 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.
End of explanation
ha_angles = (exposure_times.to(u.hour) * (u.hourangle / u.hour)).to(u.degree)
ha_angles
Explanation: A given exposure time corresponds to an angle of rotation about the telescope mount hour angle axis.
End of explanation
max_zenith_distance
Explanation: 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
End of explanation
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
Explanation: 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), the mass of the CCD camera is 0.8 kg (source here) and the mass of the adaptor is estimated to be no more than 0.2 kg.
End of explanation
<END_TASK>