hash
stringlengths
64
64
content
stringlengths
0
1.51M
e315de4ce9be4a1a98ffc1717946b6d49e32405e91494f93ae2cbb3bde276db5
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "FITS" unit format. """ import copy import keyword import operator import numpy as np from . import core, generic, utils class Fits(generic.Generic): """ The FITS standard unit format. This supports the format defined in...
e3e58728c8c3f4b01b6101e344a55350629be010798fa5237dbf8f602a555122
# 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 result units for a given ufun...
dbbee6c4f882ec9153739ca4957fd506ffed83e064d6387b4641666fadc3edc5
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Converters for Quantity.""" import threading import numpy as np from astropy.units.core import ( UnitConversionError, UnitsError, UnitTypeError, dimensionless_unscaled) __all__ = ['can_have_arbitrary_unit', 'converters_and_unit', 'che...
5f2ce3ec27fe23b15507b46cb5c5c3c49e8932ff30fafdf963603c1474246059
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Quantity helpers for the ERFA ufuncs.""" # Tests for these are in coordinates, not in units. from erfa import dt_eraASTROM, dt_eraLDBODY, dt_pv from erfa import ufunc as erfa_ufunc from astropy.units.core import UnitsError, UnitTypeError, dimensionles...
2b7989b438fca672dccbed5470e1938557d4d2337a830af464c9f6a8882df556
# Licensed under a 3-clause BSD style license. See LICENSE.rst except # for parts explicitly labelled as being (largely) copies of numpy # implementations; for those, see licenses/NUMPY_LICENSE.rst. """Helpers for overriding numpy functions. We override numpy functions in `~astropy.units.Quantity.__array_function__`. ...
fb64a76d63b3543a2d918e5d40fd1eeccc478f6d02cf21323a8d9d33991a57f3
# 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 """ import numpy as np from astropy.units.core import UnitsError, UnitTypeError, dimensionless_unscaled from...
d3adfed999e4d5f4a53f7bb0eb8cb5f7c8a59f5da6c99464c33507d376248550
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Separate tests specifically for equivalencies.""" import numpy as np # THIRD-PARTY import pytest from numpy.testing import assert_allclose # LOCAL from astropy import constants from astropy import units as u from astropy.tests.helper import assert_qua...
34869b71d27c185cee841bc50d604338d2f608acb3577327155943d5a8483b10
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test setting and adding unit aliases.""" import pytest import astropy.units as u trials = [ ({"Angstroms": u.AA}, "Angstroms", u.AA), ({"counts": u.count}, "counts/s", u.count / u.s), ({"ergs": u.erg, "Angstroms": u.AA}, "ergs/(s cm**...
e54dc05ac60e249c13b7d407dbbdb244bc2bf3fd9bdc09f9595948727668ce87
# 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.quantity import Quantity from astropy.units.utils import quantity_asanyarray, sanitize_scale _float_finfo = finfo(float) def test_quantity_asa...
cbb0b7055a078f4c47e0f45108db946092de7296321667e852b1a6c7b2ea1645
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Regression tests for deprecated units or those that are "soft" deprecated because they are required for VOUnit support but are not in common use.""" import pytest from astropy import units as u from astropy.units import deprecated, required_by_vouni...
48836c53007cdb2f52301492b11c4f31c3a0529c999e51c9029ab203e3951230
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import sys import typing as T # THIRD PARTY import pytest # LOCAL from astropy import units as u from astropy.units import Quantity from astropy.units._typing import HAS_ANNOTATED, Annotated def test_ignore_generic_type_annotations(): """...
6d4fb0cf91440a44b4baf3cb3a50aa73e4bb995b2752b85271d7dc2323c1b1e4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the photometric module. Note that this is shorter than might be expected because a lot of the relevant tests that deal with magnidues are in `test_logarithmic.py` """ from astropy.tests.helper import assert_quantity_allclose from astropy.u...
507fe5650dc67d4b6fa192363ece5158384b3b9cb5bb24dacf65c2754233c451
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for the units.format package """ import warnings from contextlib import nullcontext from fractions import Fraction import numpy as np import pytest from numpy.testing import assert_allclose from astropy import units as u from astropy...
0abf905e4639c4fc4ad449d88a8ee31e662733beb187022b54603b9e48ef9108
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Regression tests for the units package.""" import pickle from fractions import Fraction import numpy as np import pytest from numpy.testing import assert_allclose from astropy import constants as c from astropy import units as u from astropy.units imp...
fe6f3843d96882edac814aac2fc72fa006b4f79e0ee2d2472b6baafefb0fed27
# 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 numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.utils.compat import NUMPY_LT_1_20...
7eabb6b6898ed1fecc424038fad9d8795dddb2baf9065f46072e7204180aede9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the Logarithmic Units and Quantities """ import itertools import pickle import numpy as np import pytest from numpy.testing import assert_allclose from astropy import constants as c from astropy import units as u from astropy.tests.helper i...
10f63cd2b4c0d69c8c33fb74cfacb1990bfd9b4fdbc764452fc4b082a8f214c2
# 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 HAS_ANNOTATED, Annotated @pytest.mark.skipif(sys.version_info < (3, 9), reason="...
845d78a7597c1956c55e087e8cc966c7779b19ff53fce526a0d47afbff499008
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities. """ import copy import numpy as np import numpy.lib.recfunctions as rfn import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.tests.helper import check_pickling_re...
b1c71b211e4cad6025a50bd08857fb9290ab42a2ae38b671ac259ed7db4842b3
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test the Quantity class and related.""" import copy import decimal import numbers import pickle from fractions import Fraction import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal f...
f936d0f4957d7f59d9f61d2b199956fb54cf8dd5115da5796c6e70d7396af160
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities specifically with the ERFA ufuncs. """ import erfa import numpy as np import pytest from erfa import ufunc as erfa_ufunc from numpy.testing import assert_array_equal from astropy import units as u from astropy.test...
cf6ca8366679c07f63231a1ceac9af6aaa9ab7ae4f343af623065967e7a72697
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import itertools import numpy as np import numpy.lib.recfunctions as rfn import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.units.quantity_helper.function_helpers import ( ARRAY_FUNCT...
dd537ad3478e3f3c34a87b4984ec25746e8ab68b03cedb39992d8314d6442fbd
# 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 numpy as np import pytest from erfa import ufunc as erfa_ufunc from numpy.testing import a...
e8b405d6612670fa30d1c63208c786309865eb84234dd19bbf77783641b992ff
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import sys import typing # THIRD PARTY import numpy as np import pytest # LOCAL from astropy import units as u from astropy.units._typing import HAS_ANNOTATED # list of pairs (target unit/physical type, input unit) x_inputs = [(u.arcsec, u.deg...
3009dad4836dfea7f76839fd15927ed99f44ce2c13d4dc8525fcbf091d6d3e21
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numbers import numpy as np from astropy.units import ( CompositeUnit, Unit, UnitConversionError, UnitsError, UnitTypeError, dimensionless_unscaled, photometric) from .core import FunctionQuantity, FunctionUnitBase from .units import dB, d...
d162717d5713babf9de7447ab48857e14703248030795e2af641df3aa3f2ae49
# 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 ( Quantity, Unit, UnitBase, UnitConversionError, UnitsError, UnitTypeError, dimensionless_unscaled) __all__ = ['FunctionUn...
c2ac2d6130ffd79249b795f2f981218dce2ed529a42c4ed030e359f37d20f0ca
# 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 be called, as it would ...
d6b48aa1fb31d95075aecd483ad3e4a94406ec5d1a24a34803323d1e1880c46a
# 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 this class should define ``...
c1c47dbc91d2204b1fd2a6c12b3ec3bb8b7cd25f6ea10bc5943318a0aff5c6ef
# 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, classproperty, depreca...
fc858fa13cde8ecebb68b0645c29f11b5a2aa6264b6470d69f42c2f85419d669
# 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_transf...
613fe7ea0dfd7a4e33b1685087b26f6647a25f2f021674020633e6fdd027e676
# 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 DynamicMatrixTransform from ...
ea91c6848cd36f878398a83ab5b7340d2e7c9097912c66915abb8961b5f55dbe
# 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 numpy as np import erfa f...
8ac6ae291e52aaf9c1161b439cb8335c90619d99ff8b059683a3c89065a13848
# 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, doc_components __all__ =...
e0c1d919b2cb2218492399c19f627b3a2d21a347d8b54479bb3c6bc40c082786
# 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 from astropy.coordinates....
71faf8b940a647befb3409db9ba7d3ad6bfd530167c12b28e8933a0670dadc6d
# 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_components = """ ra ...
713ad19d52bd3114e377b2817003e3a0c4619078ea670af5badf87a3d57dee53
# 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 existence of this package and de...
1b8551f1795bb99b2ede1094cc11acc2f963171103d6ed7f76e988d95aba9283
# 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 .galactic import Galacti...
655c9544d74a9c984bad46c161dc22bac9fef8512802362aa0fd9a07a9e49ad4
# 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="") class ICRS(BaseRADec...
79272ba2ea5f42cc995e0ac10e9b0122572d50e37058cd5eb2301b5faa28ffb2
# 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_OBSTIME, EQU...
8028b9fdcc436e6412a0b50ac1b41e774d00d90c2f458d1f94943eecb1ba96af
# 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.attributes import TimeAttri...
a9d489f95db23609770f711b851723b557f04ce9b9ba17f4cb8a391cb43c6422
# 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.coordinates.attributes impor...
e661c03107dc1346c629eec1244847da35f977b6dcb0f87f5af57a276d9a77e6
# 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.baseframe import frame_transf...
b4453a88648421fa2717f16aff45c6ec3324b42d2ad0fc3a8323d82eec4725c9
# 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 from astropy.coordinates.ea...
3a1506042436940454badc3798c489b3217665475c92c29725464c6e37d9094b
# 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 import ( FunctionTr...
806632abd30b13eb3f2c969f60522c409ee5d82a34d4c278b38f1293f5b966f0
# 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_transform_graph from as...
3f8a079d8f51d41036df5f5ba181ca688947d024e4240c628584df9d9c061039
# 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, BaseCoordinateFrame) from ...
71fd6d91ae8d539c8cbc0b26243801b0352f3b990f1fa3bb2fd2165f77767051
# 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.coordinates.transformati...
2314512ab555beed31ca2faecf3b6a96185ab0648ae9df7db463203d83c6ce0c
# 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, RepresentationMapping, base_doc from astr...
17cda771b23828e179ef0c8fa3b7b92415418ae4bb3345cb84a9752a064eb09d
# 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 astropy.coordinates.attr...
2d9c6858bf3d7b1e3c3f46d758f58388fa1e36c57905dcd1d40bbfd43070858b
# 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_transpose from .fk4 impor...
e417ee850c4fd437524d0545ea8afa9f3aed09996e959b39c1fabf2274eec441
# 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, ...
884f38f1d60e583f31152f6f7c26cbd55845a3681e70d0e94fe006a9cf9d756e
# 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_transf...
90bb2888a4951b00d9440b2526e7092af1c40fd2744bf82bda5de478a82ab1a7
# 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 BaseCoordinateFrame, RepresentationMa...
9eb3283b936245259ea8d118871f746909cd21d83eed2d49436e05355da47196
# 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_transf...
753d12a6e4b34519933ca1db4524a47c2b91c44402929632f1a8245c034e6eda
# 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 .baseradec import doc_co...
a80e6045288fd1d21e2458d4928549c3bba8f07b0b912c322c0ab37761c1ce60
# 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 "apparent" coordinates. It is ...
d52e871639b9b67fc3d194da557a648c00d1eae999fb38120367817d7be92111
# 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.exceptions import Astro...
4228edee1e292bb7c8d7a839f5975c9c09ddfe6af2db0bd28e2d799496297e95
# 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.coordinates import repres...
8620b48d7e88699a17e2958207c1568e47a4f0f4f545a0e9738e9a4aeade81f5
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 get_pk...
e43812ff36c827376077179c2ebe5142c23fb06947721249a7375811e8792196
# 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 import galactocentric_frame_...
0c16a38ecc3f62725f65f1cade6ef79292b079b2bfd284db5d47b2f4a7d822d7
""" 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 # test for the bug in issue #1...
90347bdb4932246b79c7bc42b63dfed3fc42d87bbc81edf905a200c373993887
# 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 import SkyCoord, EarthLo...
6eb27b210c55610a502625daefa78b7c0cea4d8cd44eb7a64f089bb48f48f27b
import pickle import pytest import numpy as np import astropy.units as u from astropy.coordinates import Longitude, representation 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 ...
379d5e27675f34546ccf59976779837920a44073e70d5b4a878deadb33022963
# 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 ( ICRS, FK5, FK4, FK4NoETe...
9021275860338ba3dfdd8849c5b44b9d90a6ad84488ef6263dccb5b0a5debc88
# 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 astropy.coordinates.angles...
f747fd09ce57172fdfe5f215c2ee284bbd08870bae8ee27b2e9ee4218dd0f6d3
# 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_frames import ICRS, FK5, Gala...
2a65591630fd9cd8bb528400df6f9c4127f777ce7c8ecfff1ba8c5a7790f0f86
# 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 appropriate test modules in this ...
959395aa536cb12ca40404b8c066755737321780f4397398015d8439be86381d
# 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 as u from astropy.tests...
964f3e73393eb068564810ff0fd257a85aa9f832ff839f83e83c11967f08cfce
# 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.coordinates.builtin_frames...
33a66018f892069836188d8ea0ed2c77ce1d508ece3ef72758d729f1ced698b6
# 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 astropy.coordinates.builtin_...
0b837868bee30d030b771506d77c24ef38f81f17d0780253ed2bc82aa5276ea0
# 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, is_O3, is_rota...
81b8560fb9ceedaa3423ea7ee69724771ea7b0469a2a5c78772f2fc0b0c42cc9
# 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 astropy import units as u fr...
b194abc368a899add1cf600e133a1e30c21a6bd75cc0b4f5d790fa95ec920c1e
# 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.utils.compat.optional_d...
1e86f14b133d3776fcf5d3530ab727138d9525b9ef76692ba96d6e482bd45e90
# 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_allclose from astropy.util...
10fe8f481e13d291c02f0d37a72a3e14f0bcb103b0f59004f0f854b69232ac20
# 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 asser...
84b642579cb16d92dc8501d9f798ff99a25cf11f904a4390ab011dfa7aace7be
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 ...
498a945061db3565b103afa3abb32c1ce347d223f39cc11e8d3f1c943393c536
# 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(): """ Test that `get_sun` works a...
4e43078833cbd52530dfb1a1a0bda5c8052d9cf850e2a23da285568e253f9877
# 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 from astropy import units...
d7c480eaa04c36659ff1c2671a510c6fe7209902f0de9496bdbd8a67cfa2a193
# 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 from astropy.coordinates ...
13878be49cd83de1e3391c897e554f97d247d1fc0500cdb106ce02831df44162
# 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 Longitude, Latitude from astr...
4d7a332f4b61e307ce34170d702dd601b240ff01de95a05eb3705a7c09c21cbf
# 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 ICRS, AltAz, LSR, GCRS, Ga...
36cdf741b7dcb047a07f2f51fbf3bb99bc3e62c9d494eb93e480e6b4775c4d40
""" 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 te...
97967f5f85016afa9dc0b5ac17d96d2a7cb0e6cf75f3b4c429511e1765568381
# 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...
8ee71d2c04c5d0ce59ca67f5c2a5292401c55a421e85d5a4e3f2270ceded532a
# 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...
9489e393948bd4e6b26e07d827797cfafaf789eba5390cfac49aec584978a22e
# 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...
6ab28a86a174b5c72e04023010c44a864feed75bb8f142143f9dabb71d7576cd
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ An extensible ASCII table reader and writer. core.py: Core base classes and functions for reading and writing tables. :Copyright: Smithsonian Astrophysical Observatory (2010) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import copy i...
1f2a3caa395400ee63fb60e8654d06c69ca43545becf5dd7c041b38ce31bb451
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. fixedwidth.py: Read or write a table with fixed width columns. :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ from . import core from ...
c924c1936a1ef42a0f20d96fc80c496ecfa4b461b59f3bbed0e540398da5eef0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Classes to read AAS MRT table format Ref: https://journals.aas.org/mrt-standards :Copyright: Smithsonian Astrophysical Observatory (2021) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu), \ Suyog Garg (suyog7130@gmail.com) """ import re...
0c87a44b5a6170b1b48b677ed6a8f98139701d828d3bba71618d7333c5e0a8ac
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. ipac.py: Classes to read IPAC table format :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import re from collections import defaultdic...
81f1a040b9ac39b41c64c0475964e173d0e1b45b8dfb53ef8864e2b736f1b1a8
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible HTML table reader and writer. html.py: Classes to read and write HTML tables `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_ must be installed to read HTML tables. """ import warnings from . import core from astropy....
ee8079714be65be23900f9c9ea85e48a75eb4beb25d1f025beb9101affc82416
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. ui.py: Provides the main user functions for reading and writing tables. :Copyright: Smithsonian Astrophysical Observatory (2010) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import re impor...
f32408958614a66f9b6dfbce30ea352f819b54ce0713398a74ee520ff08a7a27
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ An extensible ASCII table reader and writer. Classes to read DAOphot table format :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import re import numpy as np import itertools as it...
e34f42f7c6e900f584e06a09544c607143069dc67212d65202f74e5af3ed5296
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains functions for reading and writing HDF5 tables that are not meant to be used directly, but instead are available as readers/writers in `astropy.table`. See :ref:`astropy:table_io` for more details. """ import os import warnings i...
868efc68aa5f62dc295bfcaea9a8e8cdc9e17ce3eedf605f1dd2d244efd86134
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains functions for reading and writing Parquet tables that are not meant to be used directly, but instead are available as readers/writers in `astropy.table`. See :ref:`astropy:table_io` for more details. """ import os import warning...
a170a6369d3c69b533dd4636585c24107ff64d8a76f7ce3792eff8a6eadac23b
# Licensed under a 3-clause BSD style license - see LICENSE.rst # TODO: Test FITS parsing # STDLIB import io import re import gzip import base64 import codecs import urllib.request import warnings # THIRD-PARTY import numpy as np from numpy import ma # LOCAL from astropy.io import fits from astropy import __version_...
cf392e0e7d9d47de3271f6372995af6361cde14b99345a8ee3d0aff5beaf4c17
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ .. _warnings: Warnings -------- .. note:: Most of the following warnings indicate violations of the VOTable specification. They should be reported to the authors of the tools that produced the VOTable file. To control the warnings e...
f7af7a64db0de2fb2cc0779ec3755f0fb963ec2343b5b7aa95b28fbae26a9119
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains routines to verify the correctness of UCD strings. """ # STDLIB import re # LOCAL from astropy.utils import data __all__ = ['parse_ucd', 'check_ucd'] class UCDWords: """ Manages a list of acceptable UCD words. Work...
ae45d387f4b18d914eb7776dd55eb9b9cdab88bebea6d0092366f31791e95174
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Various utilities and cookbook-like things. """ # STDLIB import codecs import contextlib import io import re import gzip from packaging.version import Version __all__ = [ 'convert_to_writable_filelike', 'stc_reference_frames', 'coerce_...
fc0666f6f0fefe59292ce20f7357730eebcf856c023da17f4208242a73bc0c96
# Licensed under a 3-clause BSD style license - see LICENSE.rst import argparse import glob import logging import os import sys from astropy.io import fits from astropy.io.fits.util import fill from astropy import __version__ log = logging.getLogger('fitsdiff') DESCRIPTION = """ Compare two FITS image files and re...
3af9458b4dfbf4529ddfb0a19fd6bd4f27b96a43cbd9ae5b9b7be4c671269671
# Licensed under a 3-clause BSD style license - see PYFITS.rst import contextlib import csv import operator import os import re import sys import textwrap import warnings from contextlib import suppress import numpy as np from numpy import char as chararray from .base import DELAYED, _ValidHDU, ExtensionHDU # This ...
f6d9c5c0434522525d593a9d707f3b01890a23601449e81e119a13a39e03537d
# Licensed under a 3-clause BSD style license - see PYFITS.rst import contextlib import copy import gc import pickle import re import sys import warnings import pytest import numpy as np from numpy import char as chararray try: import objgraph HAVE_OBJGRAPH = True except ImportError: HAVE_OBJGRAPH = Fals...