hash
stringlengths
64
64
content
stringlengths
0
1.51M
deb48411e12af050d66625a13379fb60af1e3737ca57dcc41fafee210506964a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # The idea for this module (but no code) was borrowed from the # quantities (http://pythonhosted.org/quantities/) package. """Helper functions for Quantity. In particular, this implements the logic that determines scaling and resul...
e614e891d5169b4e5b13399b520b575c25aa225470975978e531e5ba2c461bf7
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Converters for Quantity.""" import numpy as np from astropy.units.core import (UnitsError, UnitConversionError, UnitTypeError, dimensionless_unscaled) __all__ = ['can_have_arbitrary_unit', 'conv...
a0a4850efbfdfecac31d9c2d49fb372eb5863c0d2617e3d56bb02460dd8b81e2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Helper functions for Quantity. In particular, this implements the logic that determines scaling and result units for a given ufunc, given input units. """ from .converters import * # By importing helpers, all the unit conversion functions needed for # ...
8b9401e22dc418f0ec2c65fec5ea3ee16fc4e49f0385b3ba7b99c4bc725006c5
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Quantity helpers for the ERFA ufuncs.""" from astropy.units.core import UnitsError, UnitTypeError, dimensionless_unscaled from . import UFUNC_HELPERS from .helpers import get_converter, helper_invariant, helper_multiplication ...
5210581995ebb4c0cbf166f86115ed744fa73cefdd06523814ab66b4903574d9
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Quantity helpers for the scipy.special ufuncs. Available ufuncs in this module are at https://docs.scipy.org/doc/scipy/reference/special.html """ from astropy.units.core import UnitsError, UnitTypeError, dimensionless_unscaled ...
a3c54f2d0a97188a826cc8afab5e04e323d9d2378764caaac074a3aa77099560
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """Separate tests specifically for equivalencies.""" # THIRD-PARTY import warnings import pytest import numpy as np from numpy.testing import assert_allclose # LOCAL from astropy import units as u from astropy.units.equivalencies import E...
04e59b63117ea1ac4b831ec7b350f3ce8154bae96ba94b3aa6c46b145637f917
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test utilities for `astropy.units`. """ import numpy as np from numpy import finfo from astropy.units.utils import sanitize_scale from astropy.units.utils import quantity_asanyarray from astropy.units.quantity import Quantity _floa...
6b8a327aab5af4942457ee7cb3209e26056f33a035ba3aaf93eaaf296b51dd0d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import units as u # pylint: disable=W0611 @pytest.mark.parametrize("solarx_unit,solary_unit", [ (u.arcsec, u.arcsec), ('angle', 'angle')]) def test_ar...
2065d43406e3483a11597bdd48a7cd8c8b8cdfbaf143b0907a5e21bd057b0a2d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for the units.format package """ import pytest from numpy.testing import assert_allclose from astropy.tests.helper import catch_warnings from astropy import units as u from astropy.constants import si from as...
30fb6b2eb898cc7fcc601b7ae1d8f3c44f3945a9f1d204a40628862424a121d1
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for the units package """ import pickle from fractions import Fraction import pytest import numpy as np from numpy.testing import assert_allclose from astropy.tests.helper import raises, catch_warnings from a...
f812b25b297b6530226d9347035032779c8bf7cf99b1cc9d4af2355d77e69838
# The purpose of these tests are to ensure that calling quantities using # array methods returns quantities with the right units, or raises exceptions. import pytest import numpy as np from astropy import units as u class TestQuantityArrayCopy: """ Test whether arrays are properly copied/used in place "...
344ddaee761ef9579cc1cd14d7d22070820bb2fddbce82113e29ee0a0b022025
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the Logarithmic Units and Quantities """ import pickle import itertools import pytest import numpy as np from numpy.testing import assert_allclose from astropy.tests.helper import assert_quantity_allclose from astropy import...
d7db36018d388aa14ecb5447678c59eaf785f419576627d1c2ee262958bf3eb0
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the Quantity class and related. """ import copy import pickle import decimal from fractions import Fraction import pytest import numpy as np from numpy.testing import (assert_allclose, assert_array_equal, ...
8e96dbe9a96c356f52de21fcc21905ff4da561c7b516caaa1d4c126d9447d74f
import numpy as np import pytest from astropy import units as u class TestQuantityLinAlgFuncs: """ Test linear algebra functions """ @pytest.mark.xfail def test_outer(self): q1 = np.array([1, 2, 3]) * u.m q2 = np.array([1, 2]) / u.s o = np.outer(q1, q2) assert np...
a7cf0fe785ab23d2f0fe95709e652b7e5612830f583a7e9c1c626ed9304ee11b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for the physical_type support in the units package """ from astropy import units as u from astropy.units import physical from astropy.constants import hbar from astropy.tests.helper import raises def test_simple(): assert u....
9a4a8030c753f4f5dffe99fb6f180ccc03a8d4b036be41931f4aaba5cd2eede6
# The purpose of these tests are to ensure that calling ufuncs with quantities # returns quantities with the right units, or raises exceptions. import warnings from collections import namedtuple import pytest import numpy as np from numpy.testing import assert_allclose from astropy import units as u from astropy.uni...
5a7946e68481b9dc481bde5247e3c677debf3cb917f431e5c75591c0c1c8c32d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import units as u # list of pairs (target unit/physical type, input unit) x_inputs = [(u.arcsec, u.deg), ('angle', u.deg), (u.kpc/u.Myr, u.km/u.s), ('speed', u.km/u.s), ([u.arcse...
93fae62e10819cf7ed8b897591aeae6a0c662b4d1eb0ce8552fb51615bacb33a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.units import (dimensionless_unscaled, photometric, Unit, CompositeUnit, UnitsError, UnitTypeError, UnitConversionError) from .core import Functi...
c832903d61481ae45b9abcac932faaf5d65223dcbe835aec7064f19f21346201
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Function Units and Quantities.""" from abc import ABCMeta, abstractmethod import numpy as np from astropy.units import (Unit, UnitBase, UnitsError, UnitTypeError, UnitConversionError, dimensionless_u...
01063464a7202fe5ed95b84fa435596940388cb98b0bcda9e15bc86173900b3e
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module has been deprecated and moved to astropy.units.photometric. The names remain here for backwards compatibility. """ from warnings import warn from astropy.units.photometric import AB, ST from astropy.utils import d...
0f863d73de37e1cff52822fa4bc83301cb7cf45429862f74d83f4b008394e71e
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import numpy as np from astropy import units as u from astropy.utils.decorators import format_doc from astropy.utils.exceptions import AstropyDeprecationWarning from astropy.coordinates.angles import Angle from as...
c7b72be6ab0279bf6186ccd374031edcc5a581f2c99da041bc7239b0434f64aa
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.coordinates.matrix_utilities import (rotation_matrix, matrix_product, matrix_transpose) from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transform...
530ee94fda68be1ca7227469504b524bf9e80077c2b4095a24a7f6a4b2cb7c9b
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates.baseframe import frame_transform_graph, base_doc from astropy.coordinates.attributes import TimeAttribute from astropy.coordinates.transformations import Dyna...
65c3490f78eabee2bbef3f8cebc41412aa96118b38690e99872a8867706cfc3c
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to/from ITRS, GCRS, and CIRS. These are distinct from the ICRS and AltAz functions because they are just rotations without aberration corrections or offsets. """ import numpy as...
849b688ccf16f57c1114bcb4afa42bc0df3f4dcbdfe0af41f313c7a607358ffd
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates.attributes import TimeAttribute from .utils import DEFAULT_OBSTIME from astropy.coordinates.baseframe import base_doc from .baseradec import BaseRADecFrame, d...
f570e62cd35dc3517734a380d9ac52eb4dc1ba08cbc2d38170618f7d6fd2dfad
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates.baseframe import frame_transform_graph, base_doc from astropy.coordinates.attributes import TimeAttribute f...
847fc986a60dc8c0dddc18ad8939d3fd3d137bb3a8a223aec01aee9c8837fabc
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates import representation as r from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc __all__ = ['BaseRADecFrame'] doc_...
e272b8dd7d90cb9b2e3382c46c6b1a69d0295188ba94131bf879d575dd3dae4f
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains the coordinate frames actually implemented by astropy. Users shouldn't use this module directly, but rather import from the `astropy.coordinates` module. While it is likely to exist for the long-term, the...
86adbb837239a609551689ad75204e35e324d607ad7fd88be6234ee9ed233eda
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates import representation as r from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc from ...
d43e8dfb1efc70504e34a6a0fe4156669f9a7b6b8498fcc2ecd1652ae661670f
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates.baseframe import base_doc from .baseradec import BaseRADecFrame, doc_components __all__ = ['ICRS'] @format_doc(base_doc, components=doc_components, footer=...
105e0d2d0174ee2c900b98327ecb8c18c50eef1ba2d6451dbfa24157ff9681ed
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates.attributes import (TimeAttribute, CartesianRepresentationAttribute) from .utils import DEFAULT_OBSTIM...
cfc8e8ea8524e107a763fc8996398f71e509a3c058184f4c4c0796960f495689
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates import representation as r from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc from ...
3da705e55e58e535f54f1e400d081c7ba30fe0c1e7df2e13811668d1b8c2b19d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates.representation import CartesianRepresentation, CartesianDifferential from astropy.coordinates.baseframe import BaseCoordinateFrame, base_doc from astropy.coor...
114119261c1b227db86a5f1331e136fa75d504452c53297c1c9e26170b95d45b
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions/values used repeatedly in different modules of the ``builtin_frames`` package. """ import warnings import numpy as np from astropy import units as u from astropy import _erfa as erfa from astrop...
d41dbd4403fde735de1c4300dc82648ba91529e7dd9e80976bc9cebd36137c0e
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to/from ecliptic systems. """ from astropy import units as u from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transformations import ( ...
026a7f4f86218a1c985abf14794e877d1dfc865093c7b4c5b5fe1fe183c6275f
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting from ICRS/HCRS to CIRS and anything in between (currently that means GCRS) """ import numpy as np from astropy import units as u from astropy.coordinates.baseframe import frame...
2649d2d151cae481b77b256e7d27bef2b885a979f04b0a6adc618b56b3e0835b
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.compat import namedtuple_asdict from astropy.coordinates import representation as r from astropy.coordinates.transformations import DynamicMatrixTransform, FunctionTransform from ast...
7c201742d728f80b4dbbfc869c7063677ed3f4ae7f53eb299ba06287b9fbb108
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to "observed" systems from CIRS. Currently that just means AltAz. """ import numpy as np from astropy import units as u from astropy.coordinates.baseframe import frame_transfor...
a09b4cea66391b784ec8471fd5fb2a9cd358f1282cde614fd00ee26db815c250
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates import representation as r from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMap...
1d821bf7ef3be20a1c0afbcc4bf54da15cfe05397f8836136fe9111326672016
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.decorators import format_doc from astropy.time import Time from astropy.coordinates import representation as r from astropy.coordinates.baseframe import (BaseCoordinateFrame, Repres...
c5359a834ab83148c5c589c18b320d082a511a1d2b24dc34db19ab05102e6402
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.coordinates.matrix_utilities import (rotation_matrix, matrix_product, matrix_transpose) from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transform...
5d00674914628b7948aac3edd6248672039eeddb2066f5b45475046a3102b7d9
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.utils.decorators import format_doc from astropy.coordinates.angles import Angle from astropy.coordinates import representation as r from astropy.coordinates.baseframe import BaseCoordinat...
4b2605de01c4c465c3ca5a265e0dddb39a54d4459ecafa3b18a804641f7e5029
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.coordinates.matrix_utilities import (rotation_matrix, matrix_product, matrix_transpose) from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transform...
3cbb95e0c8323b568321a04a6a49e86b33dc1009098649534ca50b7f9acefccc
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.decorators import format_doc from astropy.coordinates.attributes import TimeAttribute from astropy.coordinates.baseframe import base_doc from .baseradec import doc_components, BaseRADecFrame from .utils import DE...
aaf5e868cdec9f697ba6d981ac0ba262168d44251e08f6b86520f0312a0003e5
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np from astropy import units as u from astropy.tests.helper import (catch_warnings, pytest, assert_quantity_allclose as assert_allclose) from astropy.utils im...
a4c5586aa11c1ee30a8c3281296350e45e9ed76db4a80add8384b658407b72f6
""" This file tests the behavior of subclasses of Representation and Frames """ from copy import deepcopy from collections import OrderedDict import pytest from astropy.coordinates import Longitude, Latitude from astropy.coordinates.representation import (REPRESENTATION_CLASSES, ...
73e8bdf441c39764971631b1d533f4fb6b523c4ef971cad7634aa57aed0122fe
import pytest import numpy as np from astropy.time import Time from astropy import units as u from astropy.constants import c from astropy.coordinates.builtin_frames import GCRS from astropy.coordinates.earth import EarthLocation from astropy.coordinates.sky_coordinate import SkyCoord from astropy.coordinates.solar_s...
81733c70d799d556b81a018b0806652e65c007ba4bde9a1363b684f4657a5720
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy import units as u from astropy.coordinates import transformations as t from astropy.coordinates.builtin_frames import ICRS, FK5, FK4, FK4NoETerms, Galactic, AltAz from astropy.coordin...
2bdff7b8a32f35f9a6729dd235a810476e3424c35bf40edf134d20479df02dd8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy import units as u from astropy.coordinates import (SphericalRepresentation, Longitude, Latitude, SphericalDifferential) class TestManipulation(): """Manipulation of Representation shape...
7566c933a11f5cba0d5bb7d9f73697f69886d9b821e3a40c596b96469e7461d6
import pytest import numpy as np from astropy.tests.helper import assert_quantity_allclose from astropy import units as u from astropy.time import Time from astropy.coordinates import EarthLocation, SkyCoord, Angle from astropy.coordinates.sites import get_builtin_sites @pytest.mark.remote_data @pytest.mark.parame...
54070e3741e30ed250d0f6a59dca7557c1a7dfdce23bebdf45668bce7ec47840
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy import units as u from astropy.coordinates import Longitude, Latitude, EarthLocation, SkyCoord # test on frame with most complicated frame attributes. from astropy.coordinates.builtin_frames import ICRS, Alt...
d62b69cf6cce600732f9a875d38867f7df63d072b7750fc8059db43e81d8a63d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy import units as u from astropy.coordinates.builtin_frames import ICRS, Galactic, Galactocentric from astropy.coordinates import builtin_frames as bf from astropy.units import allclose...
638b3ba2ef95de2e7ba2fd3ade5481267125dd2d342f1479b8c35f79d84e3d27
# -*- coding: utf-8 -*- """ Tests the Angle string formatting capabilities. SkyCoord formatting is in test_sky_coord """ from astropy.coordinates.angles import Angle from astropy import units as u def test_to_string_precision(): # There are already some tests in test_api.py, but this is a regression # te...
7f280e33446d62e2382a3b6a2cbe6e1eac5199f8af377bb835b1a632f2d46724
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy import units as u from astropy.coordinates.distances import Distance from astropy.coordinates.builtin_frames import ICRS, FK5, Galactic, AltAz, SkyOffsetFrame from astropy.coordinates ...
bcf7389e56983781fe8ecf4b3ce341dff2f8aea109a6f635dfcbbeb949182246
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains tests for the name resolve convenience module. """ import time import urllib.request import pytest import numpy as np from astropy.coordinates.name_resolve import (get_icrs_coordinates, NameResolveError, ...
6823c6e0a3cf9fc1a0db6561df99e8420d3e87b6c329cd31bcca0708a4938a8d
import pickle import pytest import numpy as np from astropy.coordinates import Longitude from astropy import coordinates as coord from astropy.tests.helper import pickle_protocol, check_pickling_recovery # noqa # Can't test distances without scipy due to cosmology deps try: import scipy # pylint: disable=W0611 ...
3ca12f052a4bfb3d8e7f8596f9a32a51ffc6014aace7e296b7e310b7a4122339
import pytest import warnings # autouse makes this an all-coordinates-tests fixture # this can be eliminated if/when warnings in pytest are all turned to errors (gh issue #7928) @pytest.fixture(autouse=True) def representation_deprecation_to_error(): warnings.filterwarnings('error', 'The `representation` keyword/...
a0a49e3ff03eb8a07561b69ffa6cc4e493a9c846944aadff1f3dc8a278d50107
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy import units as u from astropy.coordinates.distances import Distance from astropy.coordinates.builtin_frames import (ICRS, FK5, FK4, FK4NoETerms, Galactic, ...
ef823756f472a07446c0bafe21b5269a71701c545c00352e1c903c52a2cd301e
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test initalization and other aspects of Angle and subclasses""" import pytest import numpy as np from numpy.testing import assert_allclose, assert_array_equal from astropy.coordinates.angles import Longitude, Latitude, Angle fr...
9bd200c28f962f8dd8bf4c809d3ca4824b60b83b3b006139e4354578096cc680
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the projected separation stuff """ import pytest import numpy as np from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy import units as u from astropy.coordinates.builtin_frame...
d3d32f6a21a48891f0aa4b0797a36a671addb1b75ff7277a77ef5ed3625fe164
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is the APE5 coordinates API document re-written to work as a series of test functions. Note that new tests for coordinates functionality should generally *not* be added to this file - instead, add them to other appropriat...
57e24537cccc844a4aa19359116536403faf676cb6e43bd26271e1fe4f2f3728
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for putting velocity differentials into SkyCoord objects. Note: the skyoffset velocity tests are in a different file, in test_skyoffset_transformations.py """ import pytest import numpy as np from astropy import units...
fb1056a97735e83d00ab492c07da3c7a5d776ac2a89404845bc84cd5cabaebe1
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.utils import NumpyRNGContext def randomly_sample_sphere(ntosample, randomseed=12345): """ Generates a set of spherical coordinates uniformly distributed ove...
07b28d6c8c77ebc43e00b56bace51c4f06f5fdd4ced8a2d7ba35b15803101d3d
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import pytest import numpy as np from astropy import units as u from astropy.coordinates import (PhysicsSphericalRepresentation, CartesianRepresentation, CylindricalRepresentation, SphericalRepresentation, ...
2be805ad35f8f1f4b12935fe2fb0e1273022ec47e20acbbc824988112141a228
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import pytest import numpy as np from numpy import testing as npt from astropy import units as u from astropy.time import Time from astropy.coordinates.builtin_frames import ICRS, AltAz from astropy.coordinates.bu...
16ddb2911b2f5af710e9a883354939736e3cae8208dbb44ff16b2b4d3aaa0210
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test replacements for ERFA functions atciqz and aticq.""" from itertools import product import pytest from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy.time import Time from astropy imp...
bee8bf24f6a55e9ac8a952336c8baf99bb18b1755c816b83059428b49a87c4f0
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from numpy.testing import assert_allclose, assert_array_equal from astropy import units as u from astropy.coordinates.matrix_utilities import rotation_matrix, angle_axis def test_rotation_matrix(): assert_a...
57898674f611ec7769552755720385adc9af687e1f45f7120354c74e0d563fee
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for coordinates-related bugs that don't have an obvious other place to live """ import io import copy import pytest import numpy as np from astropy import units as u from astropy.coordinates import (AltAz, ...
c597a5ff79722db1dd69c07d97a2b5764a331626652308789207ea1878a76c4b
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy import testing as npt from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy import units as u from astropy.utils import minversion from astropy.coor...
ef9b7cea8bb6b05dd9c74ce22a5c155c1faf118a6a36581d55db8d1883c670e8
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy import testing as npt from astropy import units as u from astropy.time import Time from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy.coordinate...
46cf8f4ff04c32c667f8fb55834dae7ce2e40b79c1fcc1c9cc8edb6c80784e79
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy from collections import OrderedDict import pytest import numpy as np from numpy.testing import assert_allclose from astropy import units as u from astropy.tests.helper import (assert_quantity_allclose as...
410abf39e64dbe32b666d2003917f9a1b96d3f95c5084b30bef16b9ede0bcc4b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Accuracy tests for GCRS coordinate transformations, primarily to/from AltAz. """ import pytest import numpy as np from astropy import units as u from astropy.tests.helper import (assert_quantity_allclose as assert_allclose) from astropy.time import T...
2976bb3171c8545b787bbd1e20804525d966bb393f060481026d5ce2146410b6
import pytest from astropy.tests.helper import assert_quantity_allclose from astropy.units import allclose as quantity_allclose from astropy import units as u from astropy.coordinates import Longitude, Latitude, EarthLocation from astropy.coordinates.sites import get_builtin_sites, get_downloaded_sites, SiteRegistry ...
a2566171fd967f88960a2ff609fc783300925deb2827dd7a520567d8d9ebcda1
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for miscellaneous functionality in the `funcs` module """ import pytest import numpy as np from numpy import testing as npt from astropy import units as u from astropy.time import Time from astropy._erfa import ErfaWa...
72af72ee93e8138e36465ded5445638304897b59a4aed0ece8cfbd7ae44da7b8
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the SkyCoord class. Note that there are also SkyCoord tests in test_api_ape5.py """ import copy import pytest import numpy as np import numpy.testing as npt from astropy import units as u from astropy.tests.helper...
831dfab77182343cce01647046e2616478a0e54b784b99356712d603cdc3876a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This includes tests for the Distance class and related calculations """ import pytest import numpy as np from numpy import testing as npt from astropy import units as u from astropy.units import allclose as quantity_allclose f...
852a4bc04414c5b2bbbf25ca09a2a353cbdb386516f952830b889a634e4c4782
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test initialization of angles not already covered by the API tests""" import pickle import pytest import numpy as np from astropy.coordinates.earth import EarthLocation, ELLIPSOIDS from astropy.coordinates.angles import Longi...
39ceb0e296fac30d0beb9fc9aa50fcb9c2ecb7e6df01b79522197859ecf95812
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy.units import allclose as quantity_allclose from astropy import units as u from astropy import constants from astropy.time import Time from astropy.coordinates.builtin_frames import IC...
6a615c64c491f8e87b02fea94ee92a737060b0034fdeacf114c41b9a9cc6ef4d
""" This series of functions are used to generate the reference CSV files used by the accuracy tests. Running this as a comand-line script will generate them all. """ import os import numpy as np from astropy.table import Table, Column def ref_fk4_no_e_fk4(fnout='fk4_no_e_fk4.csv'): """ Accuracy tests for...
1a76763f96794e4bb4b1e85a7003027ed4c900d110d5eed21d0b23c0ed7061e7
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.coordinates.builtin_frames import Galactic, FK4 from astropy.time import Time from astropy.table import Table from astropy.coordinates.angle_utilities import angular_separation from astropy....
4c3696122f6355256fa84819b88cb593cf8bf22f4277a8bed8ba274c9b1e1f3e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.coordinates.builtin_frames import ICRS, FK5 from astropy.time import Time from astropy.table import Table from astropy.coordinates.angle_utilities import angular_separation from astropy.util...
ca26ee54a09f84370c65d1ba3064130b9e27715096ad7a3ff3526ed1fc31617a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from astropy.coordinates.builtin_frames import FK4NoETerms, FK4 from astropy.time import Time from astropy.table import Table from astropy.coordinates.angle_utilities import angular_separation from astro...
34ba96f647f92a86e50874998b39a92c1231e9c4162468e1bca82c3bf0607888
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Accuracy tests for Ecliptic coordinate systems. """ import numpy as np import pytest from astropy.units import allclose as quantity_allclose from astropy import units as u from astropy.coordinates import SkyCoord from astropy.coordinates.builtin_fra...
ab81547069743ec22fc08474dd67fd9ae9012fe9b44757b5826dc5569dbfc926
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Accuracy tests for AltAz to ICRS coordinate transformations. We use "known good" examples computed with other coordinate libraries. Note that we use very low precision asserts because some people run tests on 32-bit machines and we want the tests to p...
0a93b6c07c04465f570c5d22a26c1c923b6b4c4cc5414b34611901be5ff1e72f
# Licensed under a 3-clause BSD style license - see PYFITS.rst import bz2 import gzip import errno import http.client import mmap import operator import pathlib import io import os import sys import tempfile import warnings import zipfile import re from functools import reduce import numpy as np from .util import ...
a7ad88efcb9e47cf2b00ddb091984aee775acb2a6de7a123c5f1a0de801f203d
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import re import warnings from collections import OrderedDict from astropy.io import registry as io_registry from astropy import units as u from astropy.table import Table, serialize, meta, Column, MaskedColumn from astropy.table.table import ...
47ead76c5e59091a327187103fe53224094304d3dd10e004bdfcb24b2fda5022
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Facilities for diffing two FITS files. Includes objects for diffing entire FITS files, individual HDUs, FITS headers, or just FITS data. Used to implement the fitsdiff program. """ import fnmatch import glob import io import operator import os.path i...
a61a544ee28c51ba84ac16eb8662d19e2ce119f815d027bc30863e812bb811b0
# Licensed under a 3-clause BSD style license - see PYFITS.rst """ A package for reading and writing FITS files and manipulating their contents. A module for reading and writing Flexible Image Transport System (FITS) files. This file format was endorsed by the International Astronomical Union in 1999 and mandated by...
7f3fa5efcdd3dbccfdc8d7454cd8061d25c1d48ade46eada3ad5f8a1a927f06b
# Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import operator import re import sys import warnings import weakref import numbers from functools import reduce from collections import OrderedDict from contextlib import suppress import numpy as np from numpy import char as chararray from ....
cd888a3a4f20cf0c5ce67c859f441c68d412f89a1c39fead86f38a3f44cc2ed1
# Licensed under a 3-clause BSD style license - see PYFITS.rst import collections import copy import itertools import re import warnings from .card import Card, _pad, KEYWORD_LENGTH, UNDEFINED from .file import _File from .util import encode_ascii, decode_ascii, fileobj_closed, fileobj_is_binary from ._utils import p...
f310e6a4f73ee5cdfa2037c9a0253f43f1b23396d1be77ee03c018ad784bd17c
# Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import operator import warnings import weakref from contextlib import suppress from functools import reduce import numpy as np from numpy import char as chararray from .column import (ASCIITNULL, FITS2NUMPY, ASCII2NUMPY, ASCII2STR, ColDefs,...
ab2289acbc429bbd99de6472642cff4e4ad57f6e0ec7ed87cd92551373012a11
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re import warnings from collections import defaultdict, OrderedDict import numpy as np from . import Header, Card from astropy import units as u from astropy.coordinates import EarthLocation from astropy.table import Column from astropy.time imp...
e27e499ce980e1131b4831d0071095781384a3a28b15a8758c56c192d9d01c95
# Licensed under a 3-clause BSD style license - see PYFITS.rst """ Convenience functions ===================== The functions in this module provide shortcuts for some of the most basic operations on FITS files, such as reading and updating the header. They are included directly in the 'astropy.io.fits' namespace so ...
84966053fae3e007c4c48a4d32aac54facbc325bf4441541d9e4fee4b46e77da
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os from distutils.core import Extension from glob import glob from astropy_helpers import setup_helpers from astropy_helpers.distutils_helpers import get_distutils_build_option def _get_compression_extension(): # 'numpy' will be replaced wit...
8005b0253f9f3b0c34b34f5e3e62b46b27d9062392d895b4b8100a3368ad9519
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import itertools import io import mmap import operator import os import platform import signal import sys import tempfile import textwrap import threading import warnings import weakref from contextlib import contextmanager, suppress from func...
5412cc3d84284b0256863c121b59c6dba6ebe9484ef210ffcb0f168ca11a93e3
# Licensed under a 3-clause BSD style license - see PYFITS.rst import re import warnings import numpy as np from .util import _str_to_num, _is_int, translate, _words_group from .verify import _Verify, _ErrList, VerifyError, VerifyWarning from . import conf from astropy.utils.exceptions import AstropyUserWarning _...
c5b2a7e48d3d693294ae49082db4e3697bf30397ca74faf24987423a57c00b21
# Licensed under a 3-clause BSD style license - see PYFITS.rst import operator import warnings from astropy.utils import indent from astropy.utils.exceptions import AstropyUserWarning class VerifyError(Exception): """ Verify exception class. """ class VerifyWarning(AstropyUserWarning): """ Ver...
ecb86193458442f2ecabb14b8c24ee172aa8705c1af3fc88b9474698acd70d0d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. cds.py: Classes to read CDS / Vizier table format :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import fnmatch import itertools impor...
25dced53fc9413ff52387ed96b2e163e3addb792decaf775184e5eb049741ccc
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. basic.py: Basic table read / write functionality for simple character delimited files with various options for column header definition. :Copyright: Smithsonian Astrophysical Observatory (2011) :Author:...
b0b93d39226e24b3eb6d6b3eb31d287491985ecc2538c837281cc5684d7393b1
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file connects the readers/writers to the astropy.table.Table class import re import functools from astropy.io import registry as io_registry from astropy.table import Table __all__ = [] def io_read(format, filename, **kwargs): from .ui imp...