hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
38d9cd44585b1ece4f73af62e7a610cf35d604b0fc18a4495d078e8022e5f4e7 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "Console" unit format.
"""
from . import base, core, utils
class Console(base.Base):
"""
Output-only format for to display pretty formatting at the
console.
For example::
>>> import astro... |
e163ea9e1a3caee7c871bb461d56b3ce5a1aedcad21402a6eb9cee4f8c088f5d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file is automatically generated. Do not edit.
_tabversion = '3.8'
_lr_method = 'LALR'
_lr_signature = 'A63D4C561E2ED1A045DB279536CAFDDA'
_lr_action_items = {'CARET':([16,17,29,42,],[39,39,39,39,]),'FUNCNAME':([0,1,4,5,7,8,9,14,15,16,17,19,2... |
57eb95fa6464c345d21818ea84f4bb72dcd468b16bc453338f639567cc85a438 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
_tabversion = '3.8'
_lextokens = set(('UINT', 'PRODUCT', 'OPEN_PAREN', 'UNIT', 'SIGN', 'UFLOAT', 'DIVISION', 'CLOSE_PAREN', 'X'))
_lexreflags = 32
_lexliterals = ''
_lexstateinfo = {'INITIAL': 'inclusive'}
_lexstatere = {... |
7e217c6bf8a3403dfc759cbdde35da3c80345d319683a45c41749fca4379041b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file is automatically generated. Do not edit.
_tabversion = '3.8'
_lr_method = 'LALR'
_lr_signature = '6AD6E7286443B59D7DF329E6378BFC6B'
_lr_action_items = {'UINT':([0,2,7,9,18,22,23,28,31,32,35,37,40,42,59,60,63,],[-38,19,-20,33,-21,39,-29... |
dba25bc246004194d62eedc1690fcfd1fe16fa8b7fb3d0a958f29a669f10cb4e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
A collection of different unit formats.
"""
# This is pretty atrocious, but it will prevent a circular import for those
# formatters that need access to the units.core module An entry for it should
# exist in sys.modules since astropy.units.core imp... |
025cecbffe6e0418813720533ec45c5db13a28fe84e0ac1f2d6ea4df64bdfbe1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "VOUnit" unit format.
"""
import copy
import keyword
import operator
import re
import warnings
from . import core, generic, utils
class VOUnit(generic.Generic):
"""
The IVOA standard for units used by the VO.
This is an im... |
acbf20381e1700365602a04dbf25078a32aaf2f0248452e6e1db7531047065d2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "LaTeX" unit format.
"""
import numpy as np
from . import base, core, utils
class Latex(base.Base):
"""
Output LaTeX to display the unit based on IAU style guidelines.
Attempts to follow the `IAU Style Manual
<https:/... |
727470cf3e4fe5b4aa8a9f9af2ae0e9e14efec5240cfa9240df2dd2b68bff3d9 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "Unicode" unit format.
"""
from . import console, utils
class Unicode(console.Console):
"""
Output-only format to display pretty formatting at the console
using Unicode characters.
For example::... |
eae2ef695eb6a14bfae3a8361c461a9691b7a882e60bb813de12ddfedc90d3c2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
_tabversion = '3.8'
_lextokens = set(('CARET', 'CLOSE_PAREN', 'SOLIDUS', 'FUNCNAME', 'UFLOAT', 'STAR', 'SIGN', 'UINT', 'DOUBLE_STAR', 'OPEN_PAREN', 'PERIOD', 'UNIT'))
_lexreflags = 32
_lexliterals = ''
_lexstateinfo = {'INITIAL': 'inclusive'}
_lex... |
9f61c75ddb89b5b7e26ae513db29a6d9b61285ac9423cbcf831fbb0bbc7ae1cd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.misc import InheritDocstrings
class _FormatterMeta(InheritDocstrings):
registry = {}
def __new__(mcls, name, bases, members):
if 'name' in members:
formatter_name = members['name'].lower()
else:
... |
0d79ec19f1173dd39e8acc53aa44ea50cd5d489628d872e93fee5bc3e4607722 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICNSE.rst
# Note that files generated by lex/yacc not always fully py 2/3 compatible.
# Hence, the ``clean_parse_tables.py`` tool in the astropy-tools
# (https://github.com/astropy/astropy-tools) repository should be used to fix
# this when/... |
f84afc9757e2357e935dc9225381db7b3efab69a189738f933c05f5e7ad6fb27 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities shared by the different formats.
"""
import warnings
from fractions import Fraction
from ...utils.misc import did_you_mean
def get_grouped_by_powers(bases, powers):
"""
Groups the powers and bases in the given
`~astropy.unit... |
bd98aabe9aab967b7c0b6ae1631fcd31ce895951f0be4d368d777a473a67adf7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file is automatically generated. Do not edit.
_tabversion = '3.8'
_lr_method = 'LALR'
_lr_signature = '6FC211F72F2851FC3FF7D2BFF951FE7A'
_lr_action_items = {'UINT':([0,2,3,14,15,16,19,23,],[1,-21,20,-20,28,29,30,32,]),'PRODUCT':([2,12,13,18... |
653935f547791bf9ab0bffe2435a9a7ffa99f05f25b84aeb60893a701c313f3d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "FITS" unit format.
"""
import numpy as np
import copy
import keyword
import operator
from . import core, generic, utils
class Fits(generic.Generic):
"""
The FITS standard unit format.
This supports the format defined in... |
b6c8c93c4634356ecd4143b5a87ec7ed7c5dcaa1788de79778b8d518906c21f5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Note that files generated by lex/yacc not always fully py 2/3 compatible.
# Hence, the ``clean_parse_tables.py`` tool in the astropy-tools
# (https://github.com/astropy/astropy-tools) repository should be used to fix
# this when/if lextab/parsetab file... |
319cd9387a9f00b05702c7b4b36e54a60657e3ddc65135abcae8272618178591 | # 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.utils import assert_allclose
# LOCAL
from ... import units as u
from ... import constants
from ...tes... |
c6061ebbf7221599c53012ddd209b8791b5c0d3087e8ab2bf0ea83d39f236ac1 | # -*- coding: utf-8 -*-
# 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 .. import deprecated, required_by_vounit
from ... import ... |
f415f51b9a64d074dd8707a8a98702c163143b572f42ee739b0d12f2ef2c1c5b | # -*- 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.utils import assert_allclose
from ...tests.helper import catch_warnings
from ... import units as u
from ...constants import si
from .. impor... |
7f135f7c8e1a418736b0cf1f2ffd49d145e967ef7963380599c18efc431ac2a7 | # -*- 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.utils import assert_allclose
from ...tests.helper import raises, catch_warnings
f... |
d31ee12cb1ad061ffe762bc0bc4321853fddad68f1d8e2f7d0fd94c169dfb5c6 | # 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 ... import units as u
from ...utils.compat import NUMPY_LT_1_10_4
class TestQuantityArrayCopy:
"""
Test whether arrays... |
53dcb3c23467a5d6c24798e19ba662c98087e6608693b023e555aff558318613 | # 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.utils import assert_allclose
from ...tests.helper import assert_quantity_allclose
from ... import u... |
2faa2fb2f6be34d3f8385f9036aade59ea272a2b615b779b44884cec042b013b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import wraps
from textwrap import dedent
import pytest
from ... import units as u # pylint: disable=W0611
def py3only(func):
@wraps(func)
def wrapper(*args, **kwargs):
src = func(*args, **kwargs)... |
c62e5b0e2241ff76e17247c18c62008a3108f613e821566e464daaf70a09cb41 | # 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,
... |
c6ad841ab682b5a775b82fe0c6aebc76dfdf4fcd0630fef5a3698edfb0bc79e1 | import numpy as np
import pytest
from ... 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.all... |
dd43982d32621b9cc8f632fe16f007bd333c8a3dcbbfc4be72f3d4c0b002e541 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Regression tests for the physical_type support in the units package
"""
from ... import units as u
from ...units import physical
from ...constants import hbar
from ...tests.helper import raises
def test_simple():
assert u.m.physical_type == ... |
da157504899e8d0c5e088b667f9e6716341323590427e05f139a5a1a8ad5421d | # The purpose of these tests are to ensure that calling ufuncs with quantities
# returns quantities with the right units, or raises exceptions.
import warnings
import pytest
import numpy as np
from numpy.testing.utils import assert_allclose
from collections import namedtuple
from ... import units as u
from ...tests.... |
48db8b5f37090b97249ac28440f0b7b9a41dd1e8a25dac0b1b32d32221f7cd50 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from ... import units as u
from .py3_test_quantity_annotations import *
# 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), ... |
7114fa8e896836ad75786219942b114ede1d8e91e32388f95213aa56d1f1243e | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import CompositeUnit, UnitsError, dimensionless_unscaled
from . import magnitude_zero_points as mag0
from .core import FunctionUnitBase, FunctionQuantity
from .units import dex, dB, mag
__all__ = ['LogU... |
d04cf34218f1a7ff4bf7c66097a5e46a9c6f68a6568225bfeb29059ceb8ecf30 | # -*- 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 .. import (Unit, UnitBase, UnitsError, UnitTypeError,
dimensionless_unscaled, Quantity)
__all__ = ['FunctionUni... |
81e5ed5bb926e319331a891a486371d1b6cf04525260b0327e5b36554b6fec56 | # 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... |
3a7e8ec5be0f7400cb3736b590907a54110e401adaf533b210abfaf47a50367e | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines magnitude zero points. By default, they are used to
define corresponding magnitudes, but not enabled as regular physical units.
To enable them, do::
>>> from astropy.units import magnitude_zero_points... |
bc1bdd1309a8b919efef3473bdf2ce42f4a2b2d8a026253f8212f725c83c89f6 | # -*- 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... |
10fa5f2866135a8e8312b9530490a00f68e8482fb4b4df89f391c15fbac75fdf | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..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 shou... |
fc6782acbaf6359c5cc2703c98ca5ac088a9713ebb82c49b4e6b9bd583b04831 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from ... import units as u
from ...utils.decorators import format_doc
from ...utils.exceptions import AstropyDeprecationWarning
from ..angles import Angle
from ..matrix_utilities import rotation... |
aadf0c57ee3de06ba92c030523af0e48e329941b825d12914d462b9d9de52999 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..matrix_utilities import (rotation_matrix,
matrix_product, matrix_transpose)
from ..baseframe import frame_transform_graph
from ..transformations import StaticMatrixTransform
from .galactic im... |
43ede572f38eccac86fde8e88258ad37600bef230999db3bf95bf0b606027df3 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from ..baseframe import frame_transform_graph, base_doc
from ..attributes import TimeAttribute
from ..transformations import DynamicMatrixTransform
from .. import earth_orientation as eart... |
818a08c19c442e45ee1c4490f56bc3d7f75cba5878ed5f96760861f0fbae86ca | # -*- 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... |
a4fb2d69244bdf74bf49eac64ef13206a73a00fbae12aa13673105a2313d2edd | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from ..attributes import TimeAttribute
from .utils import DEFAULT_OBSTIME
from ..baseframe import base_doc
from .baseradec import BaseRADecFrame, doc_components
__all__ = ['HCRS']
doc_f... |
9125b91d41afbc6f797774ed3df11dce4cbb187776e4792dd1029a1a1335a0ee | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from ...utils.decorators import format_doc
from ..baseframe import frame_transform_graph, base_doc
from ..attributes import TimeAttribute
from ..transformations import (FunctionTransfo... |
94e864a13bf474662a63c61bdb99203f894a4a6d689ac4492c99fcb266d2789b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
__all__ = ['BaseRADecFrame']
doc_components = """
ra : `Angle`, optio... |
59c23b9e42f4280ed05ccbbe6af79b1a366e965d0ba5ab9bb11f4d0b99825d77 | # -*- 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... |
b4ea85be0ae6b17a2c8085c1fb89c3a80f6fa9b472ac214a639f363251a632b0 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.decorators import format_doc
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from .galactic import Galactic
__all__ = ['Super... |
a64e841319de8804d0998238c39427550a27cef7796b6f9f9cf9920127b68f8b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from ..baseframe import base_doc
from .baseradec import BaseRADecFrame, doc_components
__all__ = ['ICRS']
@format_doc(base_doc, components=doc_components, footer="")
class ICRS(BaseRADe... |
0721ffcbc7daf9fb99f4d6fe88ec8467bca125f8140a4dba8425d39d916d8b96 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.decorators import format_doc
from ..attributes import (TimeAttribute,
CartesianRepresentationAttribute)
from .utils import DEFAULT_OBSTIME, EQUINOX_J2000
from ..bas... |
1fc64e257deab017865db87fc07191db330b7f21876e4b706302e8061581946a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.decorators import format_doc
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from ..attributes import TimeAttribute
from .util... |
4e165cf23556652415023d588bafac03df2a212ee5775817cb55117c92171cb5 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from ..representation import CartesianRepresentation, CartesianDifferential
from ..baseframe import BaseCoordinateFrame, base_doc
from ..attributes import TimeAttribute
from .utils import ... |
e1d350875bdc85f2ce84a8ee4267030f94a4db18e082cae7df5ee2d2df794e24 | # -*- 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 ... import units as u
from ... import _erfa as erfa
from ...time import... |
c63b916fc1d9f9d6854a7aa98d9c7c568ed173f2d577dd4c822a33736e90587d | # -*- 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 ... import units as u
from ..baseframe import frame_transform_graph
from ..transformations import FunctionTransformWithFiniteDifference, Dynam... |
a21be4160082e672799d68a10e2afd0fe94d6effd087c5e469435b477a0626d9 | # -*- 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 ... import units as u
from ..baseframe import frame_transform_graph
from ... |
15c484e917adbf2e2b4caba0cdf977e721494bbe76570cac8a07b1fdd5ce6e72 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.compat import namedtuple_asdict
from .. import representation as r
from ..transformations import DynamicMatrixTransform, FunctionTransform
from ..baseframe import (frame_transform_graph, Repr... |
d69afe8a7a18828f6cf27705ce1cd1336d1803bc95f58663915b3871a3fc1154 | # -*- 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 ... import units as u
from ..baseframe import frame_transform_graph
from ..transfo... |
cd0e192b82faa3b478607a275e7cac394ea68bc1291e1c9bb352b2c80e9668ff | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from ...utils.decorators import format_doc
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from ..attributes import (Att... |
f5c7c47b4de20d25ba5328831489851416f3710b60a8e8d5a8336a361c56af6a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ..baseframe import frame_transform_graph
from ..transformations import DynamicMatrixTransform
from ..matrix_utilities import matrix_product, matrix_transpose
from .fk4 import FK4NoETerms
from .fk5 import... |
d186499012de99a285cc8ebcd0835971bac35d6958e896a0df93c8e031e18d9a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.decorators import format_doc
from ...time import Time
from .. import representation as r
from ..baseframe import (BaseCoordinateFrame, RepresentationMapping,
frame_t... |
188ac8bba24b48317f6fa68699a8857f9174904f8eeb69e2ed0b001403ac7043 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..matrix_utilities import (rotation_matrix,
matrix_product, matrix_transpose)
from ..baseframe import frame_transform_graph
from ..transformations import DynamicMatrixTransform
from .fk5 import... |
2cc24587958b6e5bb0e8b41cd48b925160ec3a185dae69eff9f10b38f4bbb3d3 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import units as u
from ...utils.decorators import format_doc
from ..angles import Angle
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
# these are needed fo... |
7deb275c93689d059e7851fd2b9b39096faf76b07449d041d86a499d9baa8551 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..matrix_utilities import (rotation_matrix,
matrix_product, matrix_transpose)
from ..baseframe import frame_transform_graph
from ..transformations import DynamicMatrixTransform
from .fk5 import... |
b369e0f64152b0b9d8567758b5915a85ecede39c5eaf74f6812caa4a4edb7a02 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ...utils.decorators import format_doc
from ..attributes import TimeAttribute
from ..baseframe import base_doc
from .baseradec import doc_components, BaseRADecFrame
from .utils import DEFAULT_OBSTIME
__all__ = ['CIRS']
doc_f... |
0ed1087e66bdc7cef426735e42cd7cca72a74f4a41ea6fc3a7b7fcdf80af60db | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from ... import units as u
from ...tests.helper import (catch_warnings,
pytest, quantity_allclose as allclose,
assert_quantity... |
d571d2383375120d59e3ab831ca5d6b5b1143af9927e43966d5a2932574c87b0 | """
This file tests the behaviour of subclasses of Representation and Frames
"""
from copy import deepcopy
from collections import OrderedDict
from astropy.coordinates import Longitude, Latitude
from astropy.coordinates.representation import (REPRESENTATION_CLASSES,
Sph... |
693c451ceaa125dee12ff43eea791406151e05935f226b86b94f7e27aab1163a |
import pytest
import numpy as np
from ...time import Time
from ... import units as u
from ...constants import c
from ..builtin_frames import GCRS
from ..earth import EarthLocation
from ..sky_coordinate import SkyCoord
from ..solar_system import (get_body, get_moon, BODY_NAME_TO_KERNEL_SPEC,
... |
4a9cdf829e7d7174412883251440b59ff5cab6485945e68b1a81effc94215bef | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from ... import units as u
from .. import transformations as t
from ..builtin_frames import ICRS, FK5, FK4, FK4NoETerms, Galactic, AltAz
from .. import representation as r
from ..baseframe import ... |
5a5e4c51bd90428cd45ceb8f90d980e9a97234f4c6115efe2213384fe2c35cfe | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from .. import (SphericalRepresentation, Longitude, Latitude,
SphericalDifferential)
class TestManipulation():
"""Manipulation of Representation shapes.
Checking that... |
32022759f3d78a50cb45a6c6083b2902be3645795fc4fd17c3df8706c24700e3 |
import pytest
import numpy as np
from ...tests.helper import assert_quantity_allclose
from ... import units as u
from ...time import Time
from .. import EarthLocation, SkyCoord, Angle
from ..sites import get_builtin_sites
@pytest.mark.parametrize('kind', ['heliocentric', 'barycentric'])
def test_basic(kind):
t... |
c2fabe2a00d2d9dd3ca9570f569426e1dc3ac4f8f3d14f97a7f00f37b25bc45b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from .. import Longitude, Latitude, EarthLocation, SkyCoord
# test on frame with most complicated frame attributes.
from ..builtin_frames import ICRS, AltAz, GCRS
from ...time import Time
class TestManipula... |
86a51e2f8e1b921a5c71874ccda5f85fa066b1667453ef1fea6239cd01b089d0 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from ..builtin_frames import ICRS, Galactic, Galactocentric
from .. import builtin_frames as bf
from ...tests.helper import quantity_allclose
from ..errors import Conver... |
838485d1c57a605512fbc2957bbae6656bfae0bb65d700628426d2c98b759037 | # -*- coding: utf-8 -*-
"""
Tests the Angle string formatting capabilities. SkyCoord formatting is in
test_sky_coord
"""
from ..angles import Angle
from ... 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 issu... |
96315e735c351352145f5659cf704b739ba87daf8c1e48aef8f9788e893b5257 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from ..distances import Distance
from ..builtin_frames import ICRS, FK5, Galactic, AltAz, SkyOffsetFrame
from .. import SkyCoord, EarthLocation
from ...time import Time
f... |
2c5daedd0a84782a72b4ee73a267cdad809943072f33eba4d2b47282bc453c64 | # 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 ..name_resolve import (get_icrs_coordinates, NameResolveError,
sesame_databa... |
c4e4a252e89619f049fe36cdaec13741426a8fa6011d999424c5ea94ea226f2b | import pickle
import pytest
import numpy as np
from ...coordinates import Longitude
from ... import coordinates as coord
from ...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
HAS_SCIPY ... |
46c5a58629db2986d53f15d2e6207cefb29deec677f8d7f290d71ec8ff855395 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from ..distances import Distance
from ..builtin_frames import (ICRS, FK5, FK4, FK4NoETerms, Galactic,
Supergalactic, Galactocentric, HCRS, G... |
45defb57682f22550846557cf012b2b2f84e52dd16c8d3a95ce43b95dbf17082 | # -*- 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.utils import assert_allclose, assert_array_equal
from ..angles import Longitude, Latitude, Angle
from ... im... |
ba8d9e0e0e93fd807ad91f62064b08b618966f6a5a9bd60fa850360e27fde9a3 | # -*- 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 ...tests.helper import assert_quantity_allclose as assert_allclose
from ... import units as u
from ..builtin_frames import ICRS, FK5, Galacti... |
0f6f0e51386072a198974c1631eb1fac82382f2e26be35a4013c2f0b935775ec | # -*- 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... |
92962f3e489cc11a3256dd8eab0b169356076e8cd01dfc94b20aff2b75e70b35 | # -*- 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 ... import units as ... |
2dc38755a0d7cc0ad33da14ca7457e367eec2f100a26ddbd2c1f034b58769f1c | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from ...utils import NumpyRNGContext
def randomly_sample_sphere(ntosample, randomseed=12345):
"""
Generates a set of spherical coordinates uniformly distributed over the
... |
4efd6bff8c1bdafe5d226af058dc31f77e49a4d1ca19243ab5034577560ca8b1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import pytest
import numpy as np
from ... import units as u
from .. import (PhysicsSphericalRepresentation, CartesianRepresentation,
CylindricalRepresentation, SphericalRepresentation,
UnitSphericalRepres... |
0f6b94c9dcea14d7f9d67797418fe5c03f4a87b652124881a4deb4bb4165d7b9 | # -*- 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 ... import units as u
from ...time import Time
from ..builtin_frames import ICRS, AltAz
from ..builtin_frames.utils import get_jd12
from .. import EarthLocati... |
08bcc472fc10c31d213095012dffa04caa0ef521b10368efcc406058904e932e | # -*- 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 ...tests.helper import assert_quantity_allclose as assert_allclose
from ...time import Time
from ... import _erfa as e... |
4f9ca89869f712ba7dfcaf3453ac695bd4e4c5c561b3a5aa613190345aae156c | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing.utils import assert_allclose, assert_array_equal
from ... import units as u
from ..matrix_utilities import rotation_matrix, angle_axis
def test_rotation_matrix():
assert_array_equal(rotat... |
b27fbbf0817de07cc49aceca8e47366d67344142e741989fd70b81c0103701a0 | # -*- 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 pytest
import numpy as np
from ... import units as u
from .. import (AltAz, EarthLocation, SkyCoord, get_sun,... |
ba45bafc4ccf56d43bafb9e366abbb703dca6c48a9f3f7e6f3f40aab17a96105 | # -*- 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 ...tests.helper import assert_quantity_allclose as assert_allclose
from ... import units as u
from ...utils import minversion
from .. import matching
"""
Th... |
2389f5ccb5c06258cebb58423a88694d99e0f394ab9729b4cd16cc3538015084 | # -*- 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 ... import units as u
from ...time import Time
from ...tests.helper import assert_quantity_allclose as assert_allclose
from .. import (Angle, ICRS, FK4, FK5... |
0b2d441c99eeacd31bddfcb69b6f036c43c6393ece163a19b7ab885531225043 | # -*- 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 ... import units as u
from ...tests.helper import (assert_quantity_allclose as
... |
3211f2cfd4c64f0e091da57e6d98dd9fe131040ce433cb51bffc6c3955ab95e2 | # 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 ... import units as u
from ...tests.helper import (quantity_allclose as allclose,
assert_quantity_allc... |
84fbd0e4c43fd3a41c2e94521c386a69526b455058d0beadf2ba86ca7f522406 |
import pytest
from ...tests.helper import assert_quantity_allclose, quantity_allclose
from ... import units as u
from .. import Longitude, Latitude, EarthLocation
from ..sites import get_builtin_sites, get_downloaded_sites, SiteRegistry
def test_builtin_sites():
reg = get_builtin_sites()
greenwich = reg['g... |
f1588d90756a55fac449a59fbf67b37fbecc1839087a459acd966283fd18f282 | # -*- 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 ... import units as u
from ...time import Time
def test_sun():
"""
Test that `... |
8db9d42f38986f6cfe5efb4d9394f6955637514f889e0aa453357d9d587a8a00 | # -*- 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 ... import units as u
from ...tests.helper import (... |
1a56fb176fb808046afeb5cbae475b3b1ec0f9cfbd6872d3fe76d23669f71aaf | # -*- 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 ... import units as u
from ...tests.helper import quantity_allclose
from .. impor... |
c81f988ab2b04e532c8fadf5fd2ba3c4e2f023becf0a53dff914ae6e9710a15a | # -*- 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 ..earth import EarthLocation, ELLIPSOIDS
from ..angles import Longitude, Latitude
from ...tests.helpe... |
3e564cd9adf7e91cf9e90df9f52e2dc9bc6c713a9869ca23353ea1daff513f91 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ...tests.helper import quantity_allclose
from ... import units as u
from ... import constants
from ...time import Time
from ..builtin_frames import ICRS, AltAz, LSR, GCRS, Galactic, FK5
from ... |
38c5480995be655b65616d440014fdd3139a5f496f84b1215d045fd57bd8a6cf | """
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 ....table import Table, Column
def ref_fk4_no_e_fk4(fnout='fk4_no_e_fk4.csv'):
"""
Accuracy tests for the... |
5ae8be676dca36a6eee5dc09ab73968e805d8fe579e3db705eb014e46a88c7c9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .... import units as u
from ...builtin_frames import Galactic, FK4
from ....time import Time
from ....table import Table
from ...angle_utilities import angular_separation
from ....utils.data import get_pkg_data_contents
# the nu... |
568d84ac74357e68c83092c8c7f52cf96966c8e30a00077c30a1f64f1fed05ab | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .... import units as u
from ...builtin_frames import ICRS, FK5
from ....time import Time
from ....table import Table
from ...angle_utilities import angular_separation
from ....utils.data import get_pkg_data_contents
# the number... |
1f027b2fb613d7187bc0d08741c84162bdf6ab9d072da2755cac89dcde34997b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .... import units as u
from ...builtin_frames import FK4NoETerms, FK5
from ....time import Time
from ....table import Table
from ...angle_utilities import angular_separation
from ....utils.data import get_pkg_data_contents
# the... |
21a690e2f81990c0843743a90cd57a4cb090dd051683f70215c0c7809795e2a8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .... import units as u
from ...builtin_frames import FK4NoETerms, FK4
from ....time import Time
from ....table import Table
from ...angle_utilities import angular_separation
from ....utils.data import get_pkg_data_contents
# the... |
66d1e79f1324db75d528bd3a2df805c3b913ee7ad6443cff6610229d07616df2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Accuracy tests for Ecliptic coordinate systems.
"""
import numpy as np
from ....tests.helper import quantity_allclose
from .... import units as u
from ... import SkyCoord
from ...builtin_frames import FK5, ICRS, GCRS, GeocentricTrueEcliptic, Barycent... |
0170f19bfd38aceb860fca4d518843b2da6472be71b9177c496345a4cc0d60e5 | # 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... |
6f84a14db2d22c50175e490e84d3a966c934cc7b90d8cbfc7835611e9cd239df | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import bz2
import gzip
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 numpy import memmap as Memm... |
b36d779f3ab9aca99fc3bddf61076370d65c68f6fe35d986a29146d8c8c41560 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import warnings
from collections import OrderedDict
from .. import registry as io_registry
from ... import units as u
from ...table import Table, serialize, meta, Column, MaskedColumn
from ...table.table import has_info_class
from ..... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.