Exemple #1
0
 def setUpClass(cls):
     # Create a temporary directory.
     cls.tmpdir = tempfile.mkdtemp()
     cls.ap2 = int(AstropyVersion.split('.')[0])
     # Needed for time tests.
     cls.location = EarthLocation.from_geodetic(lat=31.963972222 * u.deg,
                                                lon=-111.599336111 * u.deg,
                                                height=2120 * u.m)
Exemple #2
0
 def setUpClass(cls):
     cls.astropyVersion = int(astropyVersion.split('.')[0])
     cls.maxDiff = None
     cls.data_dir = tempfile.mkdtemp()
     if DM in os.environ:
         cls.old_env = os.environ[DM]
     else:
         cls.old_env = None
     os.environ[DM] = os.path.dirname(  # root/
         os.path.dirname(  # py/
             os.path.dirname(  # desidatamodel/
                 os.path.dirname(__file__))))  # test/
     cls.doc_dir = os.path.join(os.environ[DM], 'doc')
Exemple #3
0
    def astropy_version_check(minimum):
        """
        Check if *astropy* package is installed at given or later version.

        Parameters :
            minimum: *str*
                Minimum version, e.g., *'3.1.2'*.

        Returns :
            out: *bool*
                Is the installed version later?
        """
        current = astropy__version__.split(".")
        required = minimum.split(".")
        for i in range(len(required)):
            if int(current[i]) < int(required[i]):
                return False
        return True
Exemple #4
0
Useful quantities to be used throughout the sami package.

Note that actual use of these values varies: some modules correctly use this
module, but others define these values themselves, so do not assume that a
change made here will be correctly propagated everywhere.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import astropy.units as u
import astropy.coordinates as coords
import os.path
from astropy import __version__ as ASTROPY_VERSION

# This script contains constants that are used in other SAMI packages.

ASTROPY_VERSION = tuple(int(x) for x in ASTROPY_VERSION.split('.'))

# ----------------------------------------------------------------------------------------

# Approximate plate scale
plate_scale = 15.22

# Diameter of individual SAMI fibres in arcseconds
fibre_diameter_arcsec = 1.6

# ----------------------------------------------------------------------------------------

# ----------------------------------------------------------------------------------------
# For Andy's dome windscreen position script.
# Distance between the polar and declination axes
polar_declination_dist = 0.0625  # dome radii