hash
stringlengths
64
64
content
stringlengths
0
1.51M
3d0b648e671ba5b118cfbd83b7feb81f62766b38f9f1dbda0eae8f1bc37d1c1d
# -*- 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 import units as u from astropy import constants as ...
769fc78f6db0839c42a91be0cfee03cde01d49b6c434e42d4c154ce9cf4f4520
# The purpose of these tests are to ensure that calling quantities using # array methods returns quantities with the right units, or raises exceptions. import sys import pytest import numpy as np from numpy.testing import assert_array_equal from astropy import units as u from astropy.utils.compat import NUMPY_LT_1_21...
14fde102f4c3756a0b0dd0d37d2578d5f5965acd42b34233ff7cfab9fcdd2de5
# 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...
7a0ca4e49e3aba1bff3ec319605530ef101baca840093d29230c4f75ef34072c
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test the Quantity class and related.""" import sys import typing as T import numpy as np import pytest from astropy import units as u from astropy.units._typing import Annotated, HAS_ANNOTATED @pytest.mark.skipif(sys.version_info < ...
e2eb77762fcd9ca55cacf176d64f449d3fd3710d4a0188a7f9ca0ad7bf4ee1f8
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities. """ import copy import pytest import numpy as np import numpy.lib.recfunctions as rfn from numpy.testing import assert_array_equal from astropy import units as u from astropy.units import Structur...
45e7ad2acc9f08d38b382eb844d1896a314d01f5174c86855c34aefd4144b077
""" Test ``allclose`` and ``isclose``. ``allclose`` was ``quantity_allclose`` in ``astropy.tests.helper``. """ import numpy as np import pytest from astropy import units as u @pytest.mark.parametrize( ('a', 'b'), [([1, 2], [1, 2]), ([1, 2] * u.m, [100, 200] * u.cm), (1 * u.s, 1000 * u.ms)]) def tes...
9219b2de5580c48d66fba3bf5ebda301e22103e956a980bfb6814c463243a248
# 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 import numbers from fractions import Fraction import pytest import numpy as np from numpy.testing import (assert_allclose, assert_array_equal, ...
7097dbdaf6d86ffa329c1170043eb853ee4cabdf3f987742ca97b33e540e6f9e
# coding: utf-8 # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities specifically with the ERFA ufuncs. """ import pytest import numpy as np from numpy.testing import assert_array_equal import erfa from erfa import ufunc as erfa_ufunc from astropy import units as u f...
c5005f8ff868e6e734d07e1b49337385ccd28045c539ab7b38a358e6d3e03bb5
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import inspect import numpy as np import numpy.lib.recfunctions as rfn from numpy.testing import assert_array_equal import pytest from astropy import units as u from astropy.units.quantity_helper.function_helpers import ( ARRAY_FUNC...
d758ed469aebe661bd1c2e05078cc735d537a448964f8fb3dcb801f75bd7bd2c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Unit tests for the handling of physical types in `astropy.units`. """ import pickle import pytest from astropy import units as u from astropy.units import physical from astropy.constants import hbar from astropy.utils.exceptions import AstropyDeprec...
953392298e1313d2c1285c677f89bc8158e92351644f57b6491bf93b4943a71c
# The purpose of these tests are to ensure that calling ufuncs with quantities # returns quantities with the right units, or raises exceptions. import concurrent.futures import warnings from collections import namedtuple import pytest import numpy as np from numpy.testing import assert_allclose from erfa import ufunc...
ebb90365a0b15a55c9c706f059188b96e004949704d47a4619f58b1773d7ed13
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import sys import typing # THIRD PARTY import pytest import numpy as np # LOCAL from astropy import units as u from astropy.units._typing import HAS_ANNOTATED # list of pairs (target unit/physical type, input unit) x_in...
1d0d85bc7103f488b2f7eb3762d7cc2765574de90b33bb09cb1b7ca1c9ec4b41
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numbers import numpy as np from astropy.units import (dimensionless_unscaled, photometric, Unit, CompositeUnit, UnitsError, UnitTypeError, UnitConversionError) from .cor...
4c87eed49c2f32cc05b36b6ebb5e8c8e504d7145581abc00b00fa75f4f9401a2
# -*- 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...
eea37a0a2cd3dea0a039c068a05e342cf8683b3238d5652c1691680be15a2377
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different function units and quantities, i.e., using units which are some function of a physical unit, such as magnitudes and decibels. """ from .core import * from .lo...
cc8ef2779e1db6518a29bdea1449f7a5b090ff6e889ddc2833d9185fd09fb030
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines units that can also be used as functions of other units. If called, their arguments are used to initialize the corresponding function unit (e.g., ``u.mag(u.ct/u.s)``). Note that the prefixed versions cannot...
9301c85bd3d7346a2d4dd02782feba412d2ec6b0f340612e24d69a4b0bb27425
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.units.core import IrreducibleUnit, Unit class FunctionMixin: """Mixin class that makes UnitBase subclasses callable. Provides a __call__ method that passes on arguments to a FunctionUnit. Instances of thi...
91dfb8af20f03eda0d5f178ca352b3b890966394157b925675634d971284a6e6
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import copy from collections.abc import MappingView from types import MappingProxyType import numpy as np from astropy import units as u from astropy.utils.state import ScienceState from astropy.utils.decorators import format_doc...
b89ab1352fe46c9713d65258aa2e3c49ff79b71036f308c9ce2e48c69343b9f5
# -*- 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.basef...
86c13106d5c3c9c1e3521633d32535c4c27fbf1ada041f300d02eb6111190e31
# -*- 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...
b3de7cbde363abd2610161a18797b9b877077b66d9864a3006bafd5ba098e782
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to/from ITRS, TEME, GCRS, and CIRS. These are distinct from the ICRS and AltAz functions because they are just rotations without aberration corrections or offsets. """ import nu...
67d78174314403d18643a4ccaea07e296126b9a2c04a540b5a4e0e2448eded77
# -*- 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...
a7c44baf49eaef73feb38a9b4421b8574b72fdee2434bccd3f003cbc3757483e
# -*- 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...
636308e890f83937b54d915f3ee2bbda309adac45f90cacbb42bb383e9aff1ef
# -*- 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_...
13a1c543dcef0cbda5c894ccdeae308cb50824e59462e9fdeedb82171d906e52
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains the coordinate frames 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 existenc...
13516b367ddf52a4b8b1ca0eb7cc7a0ffa3f6b242a53770e6c3af02cf7488ca0
# -*- 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 ...
b39affef72ebd4f79f1117ddaabe523eaae7b5a2bf0cf636fa601bb0751fd4a2
# -*- 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=...
4b61932802bcae230f330b1447f59d72cf2664e2c8bdfbf60487a0e508a08a5d
# -*- 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 imp...
0d71c3d393d6d5e4a832cf0cca4ba972928d13edc37ed53e06e8be76b1b0384f
# -*- 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, base_doc from astropy.coordinates.att...
ce6c98a5232ded5801fb83a2a94f9a7e979b5fbb643f71142b2586cf0cc0dcab
# -*- 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...
588eb8d821a038bab64f86c1bff3163e0a4cbd02614856b887bbddb39c448a76
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to "observed" systems from ICRS. """ import erfa from astropy import units as u from astropy.coordinates.builtin_frames.utils import atciqz, aticq from astropy.coordinates.basef...
9bd3b2141997461a399b15302425cd33adb624b0100faec827ecf2c70e948f62
# -*- 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 erfa import numpy as np from astropy import units as u from astropy.time import Time fro...
3f6e8dccb219c67863b44aa7af1c3c8de75e488e4e4ce49ddb0430db2b689049
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to/from ecliptic systems. """ import erfa from astropy import units as u from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transformations...
1dfd6e4dfbb247e73f432953924c8421756bd59b1db167fa68d2626295810c69
# -*- 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...
4d04a23a153c69d0c88d02cd16c5e00fdd5d0cfc58ff81bab8999a3de4b77474
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.coordinates.transformations import DynamicMatrixTransform, FunctionTransform from astropy.coordinates.baseframe import (frame_transform_graph, Ba...
e769ee302a9ac4d0d3606d8cc8fb5ed3865443ad25ffbe4a29f17079cb5017ed
# -*- 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. """ import numpy as np import erfa from astropy import units as u from astropy.coordinates.baseframe import frame_transform_graph from astropy....
df7c30da5c3449a06dbb23cadd0ebed017d2378d55bac5b16efcab163eb57f22
# -*- 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...
eac1eaff5a1de37cce89ff1b1c7343fec307c481f843045cecc9ac7df09933c1
# -*- 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...
9571ca604e8b7c354cad3f0809c36c4cd62dc73ae7f2379b8ed70370981551b6
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.transformations import DynamicMatrixTransform from astropy.coordinates.matrix_utilities import matrix_product, matrix_tra...
dcfb24f373897dac8591021e18ad5b32d1f4363d764515f601afc6cba1d919c0
# -*- 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, ...
175e8537f7f14df1660f6939980a7955f5fe1cfaabc1698ea47b941d59f1e862
# -*- 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.basef...
c5fdf289fc5093f9bf7def9eb847d2b54eb1345003fb3ca4e10f45949ad83135
# -*- 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...
c1d16dcee490d7d6017feb8939afe1bf922c57efddf16f3af64eb158fe6f892f
# -*- 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.basef...
d44d5602ac196783cb84d87d3db4e1bffa1608be9306c3980aa975ccb136032a
# -*- 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, EarthLocationAttribute) from astropy.coordinates.baseframe import base_doc from ...
15c39fb1b0a57e3f8e6167ad6a1d7d4db2b6c8a178fa6b538db2a3d6989746c4
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Coordinate frames tied to the Equator and Equinox of Earth. TEME is a True equator, Mean Equinox coordinate frame used in NORAD TLE satellite files. TETE is a True equator, True Equinox coordinate frame often called the "appar...
fac22d00b17ebc2f0d1fadf9af150cb437588592757e7f396adf800c5f0e14dc
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np import pytest import re from astropy import units as u from astropy.units import allclose from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy.utils...
28ea637440b4649f5ee78e8afcc79861cded671f08b83e17cbf2b423b1495f4f
""" This file tests the behavior of subclasses of Representation and Frames """ from copy import deepcopy import pytest from astropy.coordinates import Longitude, Latitude from astropy.coordinates.representation import (REPRESENTATION_CLASSES, SphericalRepresentation, ...
39215e0a6e4a54d3dd173b1853e831d73c92a91a1581a2f0e2e095890bdca56f
import os import pytest import numpy as np from urllib.error import HTTPError from astropy.time import Time from astropy import units as u from astropy.constants import c from astropy.coordinates.builtin_frames import GCRS, TETE from astropy.coordinates.earth import EarthLocation from astropy.coordinates.sky_coordina...
9cc7358a9e444c719ed9b3f71fb60714d0c97bcfc3815845950b5f71011e3126
# -*- 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, HCRS from astropy.c...
5e54b09137efbfdca5380144d7f8d123810041eec4215963ee79ed6b0c9aa41e
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Accuracy tests for ICRS transformations, primarily to/from AltAz. """ 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 Time from astropy.coordinates...
408267004b363ec485817d48dd9e4d7f77d2c57bebba46dd7d79c741588b8c28
from astropy.tests.helper import assert_quantity_allclose from astropy.time import Time from astropy.coordinates.builtin_frames.utils import get_polar_motion, get_offset_sun_from_barycenter from astropy.coordinates.solar_system import get_body_barycentric_posvel from astropy.utils.exceptions import AstropyWarning impor...
eca03dfab7baed4ec320473ad2f25da1e57c4e81a18b02e6e3d59ede2fc5ef9c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test geodetic representations""" import pytest from numpy.testing import assert_array_equal from astropy.coordinates.representation import CartesianRepresentation from astropy.coordinates.earth import ( WGS84GeodeticRepresentation, GRS80Geode...
4468a88fbf28e26e71bd4b89b06b9884a8a422511fce57707dcfd7cb9a7bc314
# 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) from astropy.units.quantity_helper.function_helpers im...
5f880a2017d5fe792971c716d3c64313d5c15276b6b9173a0a2a020cce321a5f
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, Distance from astropy.coordinates.sites import get_builtin_sites from astropy.utils.data import downl...
582eded9773edc586612958409caee0a0775c2d71e91cdd51032505e16c6f018
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from numpy.testing import assert_array_equal import pytest from astropy import units as u from astropy.units.quantity_helper.function_helpers import ARRAY_FUNCTION_ENABLED from astropy.coordinates import Longitude, Latitude, EarthLocat...
72230942098f950d79579e3b40ac6d4a66b6b415bb615b4d54acb56f2e3c784a
# -*- 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 CIRS, ICRS, Galactic, Galactocentric from astropy.coordinates import builtin_frames as bf from astropy.coordinates impo...
7cb491fdd96ba4edf8078cc9e7249b1b2ab921c4ea804fd9e03e769bca832f32
# -*- 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 # tes...
5f3b5ae2cece9012eba70cfe5f0751a37499349794a49320e1f553a0ddb3390c
# -*- 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 ...
713baa05c33407b4203dbe2e46a7f2ab260638a3c5a47f7b4d32a5bbbeef9533
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 from astropy.coordinates.spectral_quantity import SpectralQuantity SPECTRAL_UNITS = (u.GHz, u.micron, u.keV, (1 / u.nm).unit, u.km / u.s) class TestSp...
7945ca622df4045ca464f9e9ab62ff93b59eb817b57dc65d4615180e067841cb
# 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, ...
78968631abfb5182dbf320c4aa4d16c9d5eebce189ebbed04ef1834f9b8a4dbb
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 from astropy.utils.compat.optional_deps import ...
3d7e9024a6414177dc72457315759fffb9a67cd7039e9edaf184097139f3a161
# -*- 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 import galactocentric_frame_defaults from astropy.coordinates.distances import Distance from astropy.coordinates.builtin_frames import ( ...
fe8cb29406b123f57c92238e7744c97fd35c2daad5df81297aefef855ba9821a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test initialization and other aspects of Angle and subclasses""" import threading import warnings import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal import astropy.units as u from as...
5f69e4e8c1020d40b722e241871e92cce50384bee0a3243e04b39388eea2d967
# -*- 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...
ca1d41e07ab6d06ac6fd6ea78487140d12c6e68da57619def27275d16e24f843
# -*- 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...
a8cab44dfabb74f64df017a968983176c8bec1efb29cc43b39e2f492bf7dc6ef
# -*- 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...
2a29361bcb0eee78796000d753a64de5eb43692a0170282eaa9ab587035692b4
from contextlib import nullcontext import astropy.units as u import numpy as np from numpy.testing import assert_allclose import pytest from astropy import time from astropy.constants import c from astropy.table import Table from astropy.time import Time from astropy.utils import iers from astropy.coordinates import ...
83a70e3cd86bc5a30049906ae843a078a9344fe194b142b86afd8ed9e9260a29
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import operator import pytest import numpy as np from astropy import units as u from astropy.coordinates import ( PhysicsSphericalRepresentation, CartesianRepresentation, CylindricalRepresentation, SphericalRepresentation, U...
9b463eaffc9dec347cafa71daffb014d4fa75a43289ffd0f26b0fe00d624897e
# -*- 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 import erfa from astropy import units as u from astropy.time import Time from astropy.coordinates.builtin_frames import ICRS, AltAz from astropy.co...
f7f00430bd6e96bc2a525c5735a3f2aae9b6386424cc488ee00db0baec7ad672
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test replacements for ERFA functions atciqz and aticq.""" import pytest import erfa from astropy.tests.helper import assert_quantity_allclose as assert_allclose from astropy.time import Time import astropy.units as u from astr...
c7ba655fe6b551fa6266c38f19882e90719e7cca694f4b5e65d35093d3aac3dc
# -*- 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, ...
136719af03cbfefaaf6919041702f248e0a27247d5b03aeb4961672db58bc104
import numpy as np import pytest import astropy.units as u from astropy.time import Time from astropy.utils.exceptions import AstropyWarning from astropy.coordinates import EarthLocation, AltAz, GCRS, SkyCoord, CIRS from astropy.coordinates.erfa_astrom import ( erfa_astrom, ErfaAstrom, ErfaAstromInterpolator ) ...
2015cf541d7e911db83f1cac9b388763f96ec22117a691d2f58911100224be4c
# -*- 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 contextlib import nullcontext from erfa import ErfaWarning from astr...
a3f86b5cd6af15281f580588e2a9026b9afb2cc13e4a1cb413929194d1ae15c1
# -*- 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.coordinates import matching from astropy...
902912605956da587643d175e7d7e29330b58262990ad291dc5aa2aff3935ebb
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from contextlib import ExitStack 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_al...
b732efed97ce90f2bec3a943c57faeb77b44e8ca2c877ab913b780f65223e710
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import pytest import numpy as np from numpy.testing import assert_allclose, assert_array_equal from astropy import units as u from astropy.tests.helper import (assert_quantity_allclose as ...
16df5b4a8629b6e5019d69a2f5dda60daaf0c8e56e5b940391bce0630364595c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Accuracy tests for GCRS coordinate transformations, primarily to/from AltAz. """ import os import warnings from importlib import metadata import pytest import numpy as np import erfa from astropy import units as u from astropy.tests.helper import ass...
256142e89a3d995d9bae5919968135ef31a7f4c013bfb867bec36d0e9c885116
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 ...
57613ced54bc94105e59319ad073321ec8ec1563b8730560283f3901f83c7420
"""Unit tests for the astropy.coordinates.angle_utilities module""" import numpy as np import pytest import astropy.units as u from astropy.utils import NumpyRNGContext from astropy.coordinates.angle_utilities import ( golden_spiral_grid, uniform_spherical_random_surface, uniform_spherical_random_volume )...
65c8eb65082b41a3ffefd31eb66cde2dd5339a1cad55a51085f9bdac196ad696
# -*- 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 def test_sun(): """ Tes...
bc30bdf534fe73637fb997dcdc7021c65a21c8014130c0fea154a1d0becf5c8c
# -*- 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 from copy import deepcopy import pytest import numpy as np import numpy.testing as npt from erfa import ErfaWarning f...
51c41fbe6ffe23e4bea037f3448c579a76c33f270cfb74ac4dfa41c67d106f1d
# -*- 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...
de04ef48fb51d1002f2c2d21ca7ee7bdf3e42601e208a788417fb4cf64cc66e8
# -*- 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...
62d5f2497a01dbeb71ccce8f438fca1896f4053eb27d12956199f98f690f0344
# -*- 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...
59c38fbe559b363aea1b3f1357da43305720f39939236fbb6cd425e034efb62b
""" This series of functions are used to generate the reference CSV files used by the accuracy tests. Running this as a command-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 fo...
606d2433ba5d356706f8d64d763b785989c21442e7c903d7aa8e36aed54114ee
# 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....
f81617049b783398233e18299dcfaa18a36f3032424269688ef8000beb3e5a92
# 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...
d0e06a419ae1240d446fcb5c4de9714097005687400adc66befc78e533483a7a
""" The modules in the accuracy testing subpackage are primarily intended for comparison with "known-good" (or at least "known-familiar") datasets. More basic functionality and sanity checks are in the main ``coordinates/tests`` testing modules. """ N_ACCURACY_TESTS = 10 # the number of samples to use per accuracy t...
90a28b139342c1dfe452e8c448d0c341029c3947bf4504b84778059f2eeccf51
# 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, FK5 from astropy.time import Time from astropy.table import Table from astropy.coordinates.angle_utilities import angular_separation from astro...
9ccc4275b5cf0f1d2f4eca9a03afcb7a4f4256df15268e2ea90e20db3eb3391b
# 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...
67fef5a275a395e727d0559345b9dd4b3f82ace1b0110a4de8c26b01a5130596
# 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...
a843f3422d8937a30fea7f7943a60e7903790fa4c50d860ef365a36ab0caf1f3
# Script to generate random targets, observatory locations, and times, and # run these using the Starlink rv command to generate reference values for the # velocity frame corrections. This requires that Starlink is installed and that # the rv command is in your PATH. More information about Starlink can be found # at ht...
13afa8443dc3dab7093993478b23df91589ec1921c2ada255d5ae4a3b6a9ca4d
# 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. """ import pytest import numpy as np from astropy import units as u from astropy.time import Time from astropy.coordin...
33a1380fda307fe3dbf2f689ab7a06d2c4a8f8f7c135fca3b12b854faa16bbd6
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import errno import http.client import mmap import operator 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 (isreadable, iswritable, is...
e2ac61e018c3583c7997660c2452f2459f3e7b68be0c79a380454ec4c1da63a3
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import re import warnings from copy import deepcopy import numpy as np 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.time impo...
9493ef7872aabbd433365c15c177c1613a5c203dcab4264066873cb3db57ebda
# 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 import...
8534e83065363997bf941d6e401560decd7e4418ef8b2b2c278f134d7b6e1be2
# 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...
358233df27088e66ac6e69d9deadc5e97af1aa4e25f5e0e5b3d59a1e54c3002a
# 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 ....
2e93471fd798133849d8f3a985153fb062e625c84d844425b5de05d0ff9f04bf
# Licensed under a 3-clause BSD style license - see PYFITS.rst import collections import copy import itertools import numbers 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, file...
62ea39435f33ac4f7ce76234adb42e5a47fafc4a190d10ed4faedb075c817df1
# 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,...