hash
stringlengths
64
64
content
stringlengths
0
1.51M
5e84a031c0b3f4163e9d1f66a99faf4e272736bcd366411d8ab2d957c2e2e1a1
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Utilities for generating new Python code at runtime.""" import inspect import itertools import keyword import os import re import textwrap from .introspection import find_current_module __all__ = ['make_function_with_signatu...
33f59fda24a074bb22b500845802ee0ac897c5065681fe05145ea7f729bb16e6
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utilities for console input and output. """ import codecs import locale import re import math import multiprocessing import os import struct import sys import threading import time try: import fcntl import termios ...
85f6245280a8df4012bdb07f27586dd751db6d80339023ec24fcc599c22e4947
""" A simple class to manage a piece of global science state. See :ref:`config-developer` for more details. """ __all__ = ['ScienceState'] class ScienceState: """ Science state subclasses are used to manage global items that can affect science results. Subclasses will generally override `validate`...
8d1b79a6ca67012280ca4a0012f6baadded13ad5f0ae1113a37a2c250be5836d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ A module containing specialized collection classes. """ class HomogeneousList(list): """ A subclass of list that contains only elements of a given type or types. If an item that is not of the specified type is added to the list, a `T...
299561406172ebdaa27e5487ca3ada4b24337a0b3fa538f5e69afa96afc76fc2
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Functions related to Python runtime introspection.""" import inspect import re import types import importlib __all__ = ['resolve_name', 'minversion', 'find_current_module', 'isinstancemethod'] __doctest_skip__ = [...
f0a2513e77469f1f85421a4b4074485cab695e9ecb1e043354823674c7b7cab8
# Licensed under a 3-clause BSD style license - see LICENSE.rst """General purpose timer related functions.""" # STDLIB import time import warnings from collections import Iterable, OrderedDict from functools import partial, wraps # THIRD-PARTY import numpy as np # LOCAL from .. import units as u from .. import log ...
3e42210fef752e6c90b95d2593d68bc60cee14ceafff115073fc3afa4ce738d4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains helper functions and classes for handling metadata. """ from ..utils import wraps import warnings import collections from collections import OrderedDict from copy import deepcopy import numpy as np from ..utils.exceptions impor...
29f20420bd6ec82d1c540d728960eafde8f6f93b804c1dba358a234916ba7ec2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains developer-oriented utilities used by Astropy. Public functions and classes in this subpackage are safe to be used by other packages, but this subpackage is for utilities that are primarily of use for developers or to implement...
04903eb06db93262f78a0a43174eba919ef8d532cc5bbbc4597c47546d1524d0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains errors/exceptions and warnings of general use for astropy. Exceptions that are specific to a given subpackage should *not* be here, but rather in the particular subpackage. """ class AstropyWarning(Warning): """ The base ...
5a7fce6fd927d827ce02f7cd8453b40bd564940c7c92025811a573eb798ada44
# Licensed under a 3-clause BSD style license - see LICENSE.rst from distutils.core import Extension from os.path import dirname, join, relpath ASTROPY_UTILS_ROOT = dirname(__file__) def get_extensions(): return [ Extension('astropy.utils._compiler', [relpath(join(ASTROPY_UTILS_ROOT, '...
659133687499762bbd6380dd38c0603518b927c1959a00cb9bab05e7e2d4d538
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains functions and methods that relate to the DataInfo class which provides a container for informational attributes as well as summary info methods. A DataInfo object is attached to the Quantity, SkyCoord, and ...
19aa58446b2c6841dd4f4f8893aba2ef36a8d954f0e028fc6ddb470697bf6bf2
"""Utilities and extensions for use with `argparse`.""" import os import argparse def directory(arg): """ An argument type (for use with the ``type=`` argument to `argparse.ArgumentParser.add_argument` which determines if the argument is an existing directory (and returns the absolute path). ""...
9fcdc3b66a27bf11054bb5a90bcda555580b3f2eb78c4243c53df66d371daecc
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains helper functions for accessing, downloading, and caching data files. """ import atexit import contextlib import fnmatch import hashlib import os import io import pathlib import shutil import socket import sys import time import u...
8ae05a98090d689915915b9010180e2548d49361e3702d3a624e4868b2b2bbdb
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ A "grab bag" of relatively small general-purpose utilities that don't have a clear module/package to live in. """ import abc import contextlib import difflib import inspect import json import os import signal import sys impor...
f88a53718225b85da742cac0b2115fc65cf2a2ccea081d86b5448319c49002a4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handle loading six package from system or from the bundled copy """ import imp from distutils.version import StrictVersion _SIX_MIN_VERSION = StrictVersion('1.10.0') # Update this to prevent Astropy from using its bundled copy of six # (but only i...
a0ebf94694e1b9041eb99b9eb9cb66cfd954947d06cd53e9b3c1509358a0a6aa
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os def get_package_data(): paths = [os.path.join('js', '*.js'), os.path.join('css', '*.css')] return {'astropy.extern': paths}
131ce5a64bb9fae13ab946e090a9d9b9c4e10438846254db93928fd9b067773e
""" Normalization class for Matplotlib that can be used to produce colorbars. """ import numpy as np from numpy import ma from .interval import (PercentileInterval, AsymmetricPercentileInterval, ManualInterval, MinMaxInterval, BaseInterval) from .stretch import (LinearStretch, SqrtStretch, Pow...
13d205d55822cdff646031abb07281cc01d9a97c2ad890fa7088030a9fe036c3
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .hist import * from .interval import * from .mpl_normalize import * from .mpl_style import * from .stretch import * from .transform import * from .units import * from .lupton_rgb import *
05ff8868d3e60549bd538d29de9611d6a96f21e19fd3752a48ba91336424eda9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Combine 3 images to produce a properly-scaled RGB image following Lupton et al. (2004). The three images must be aligned and have the same pixel scale and size. For details, see : http://adsabs.harvard.edu/abs/2004PASP..116..133L """ import numpy as...
7c5f18f0515170ce20f5ce2735258550eb835fbfa63709386da68645918d6009
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Classes that deal with computing intervals from arrays of values based on various criteria. """ import abc import numpy as np from ..utils.misc import InheritDocstrings from .transform import BaseTransform __all__ = ['BaseInterval', 'ManualInterv...
e38116d304a67be1a02ed55b378ff72f2907a4a020be24947efd0525f5f8170a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np __doctest_skip__ = ['quantity_support'] def quantity_support(format='latex_inline'): """ Enable support for plotting `astropy.units.Quantity` instances in matplotlib. May be (optionally) used...
b0abdc7bd893ff5f0027ebc04a7c69251f3b874e8d97960398add4ba110763b9
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module contains dictionaries that can be used to set a matplotlib # plotting style. It is no longer documented/recommended as of Astropy v3.0 # but is kept here for backward-compatibility. from ..utils import minversion # This returns False if ma...
0abfe19ddf39a968ebbbe3cdf511b78225808bfa3da39354da2c59731f05e534
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from inspect import signature from ..stats import histogram __all__ = ['hist'] def hist(x, bins=10, ax=None, **kwargs): """Enhanced histogram function This is a histogram function that enables the use of more sophisticated ...
6b6965debc48a24995e759e834954177a67be52af0259c37fe4cd51c3626581f
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['BaseTransform', 'CompositeTransform'] class BaseTransform: """ A transformation object. This is used to construct transformations such as scaling, stretching, and so on. """ def __add__(self, other): return...
1171f796d0900a9059332b5be21dfc91794d138d510f32b2b0f8d0a759131c52
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Classes that deal with stretching, i.e. mapping a range of [0:1] values onto another set of [0:1] values with a transformation """ import numpy as np from ..utils.misc import InheritDocstrings from .transform import BaseTransform __all__ = ["Base...
fb0c2f215cb928a11ea34cc823a7593256d34509ed0f4c610f4cca5f3d90b669
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy from inspect import signature from itertools import islice import warnings from ..utils import wraps from ..utils.exceptions import AstropyUserWarning from .nddata import NDData __all__ = ['support_nddata'] # All supported ...
7e6f0186b4d61278a1a70ab055b5827f5ef23896c7e376434efce07293ab5acd
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base NDDataBase class. from abc import ABCMeta, abstractmethod __all__ = ['NDDataBase'] class NDDataBase(metaclass=ABCMeta): """Base metaclass that defines the interface for N-dimensional datasets with associated ...
b7733432be3aa6d7f548514e6a43889f3a7cba7f64c40a88390f60dcbc105a7b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from abc import ABCMeta, abstractmethod from copy import deepcopy import weakref # from ..utils.compat import ignored from .. import log from ..units import Unit, Quantity __all__ = ['MissingDataAssociationException', 'Inc...
4088547764692288bd0f788d383e49af7e88f113750aecb614a8d41157fd519e
# Licensed under a 3-clause BSD style license - see LICENSE.rst from collections import OrderedDict import numpy as np from ..utils.misc import isiterable __all__ = ['FlagCollection'] class FlagCollection(OrderedDict): """ The purpose of this class is to provide a dictionary for containing arrays of ...
c055a75e98e0a7124e60b85bc9dfce1598f4e344a582bd4dd42b4cca744b6d49
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base NDData class. import numpy as np from copy import deepcopy from .nddata_base import NDDataBase from .nduncertainty import NDUncertainty, UnknownUncertainty from .. import log from ..units import Unit, Quantity from ..ut...
045b64842f3bb755954f51b9fdf1e64827c72e9ed6fd940fbbe84078cb092254
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The `astropy.nddata` subpackage provides the `~astropy.nddata.NDData` class and related tools to manage n-dimensional array-based data (e.g. CCD images, IFU Data, grid-based simulation data, ...). This is more than just `numpy.ndarray` objects, becaus...
8aff5abd366abdcbb6dd88b2a5062dcbd460efb806db89a340601ea89f70bdf7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module implements the base CCDData class.""" import numpy as np from .compat import NDDataArray from .nduncertainty import StdDevUncertainty, NDUncertainty from ..io import fits, registry from .. import units as u from .. import log from ..wcs im...
0a8478a941809b2acb423274acc96468cb955cf6f84ec126bf807ba662640c55
# Licensed under a 3-clause BSD style license - see LICENSE.rst def get_package_data(): return {'astropy.nddata.tests': ['data/*.fits']}
5a08fc56dbac243bc68d3740f377ee68361a543de89919cc836c7e958cca3e51
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module includes helper functions for array operations. """ from copy import deepcopy import numpy as np from .decorators import support_nddata from .. import units as u from ..coordinates import SkyCoord from ..utils import lazyproperty from ..w...
9aaf4a56b98688be4b7355e0d6f5f3d82456884b0ac613ee6bb7d331076991a3
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module contains a class equivalent to pre-1.0 NDData. import numpy as np from ..units import UnitsError, UnitConversionError, Unit from .. import log from .nddata import NDData from .nduncertainty import NDUncertainty from .mixins.ndslicing imp...
8d1e51fff71704051e8dd5571178f6f889e5814a46e27e5de5d181a533dab62f
# Licensed under a 3-clause BSD style license - see LICENSE.rst try: # The ERFA wrappers are not guaranteed available at setup time from .core import * except ImportError: if not _ASTROPY_SETUP_: raise
a6c802ea2c89a4232cc6c6569300b6320a68e4e7ea2bb49aea0fb5bec446ae8a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module's main purpose is to act as a script to create new versions of erfa.c when ERFA is updated (or this generator is enhanced). `Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this module/script to function. Note that this does *not...
8fd36b492cbee8454f9cbee7fd14dbb5892d80cc2e2a04325e905b9d67feb423
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import glob from distutils import log from distutils.extension import Extension from astropy_helpers import setup_helpers from astropy_helpers.version_helpers import get_pkg_version_module ERFAPKGDIR = os.path.relpath(os.path.dirname(__file__...
ed0831132c31d356d8a553e0e77a8845908e345ce33a94bcd684a87dc3e72ab8
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ .. _wcslib: http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/index.html .. _distortion paper: http://www.atnf.csiro.au/people/mcalabre/WCS/dcs_20040422.pdf .. _SIP: http://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/shupeADASS.pdf .. _FITS...
c3d6fdb8592c828c9798928a53c34479ce97a51704c97b552887dc1e33304725
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ astropy.wcs-specific utilities for generating boilerplate in docstrings. """ __all__ = ['TWO_OR_THREE_ARGS', 'RETURNS', 'ORIGIN', 'RA_DEC_ORDER'] def _fix(content, indent=0): lines = content.split('\n') indent = '\n' + ' ' * indent ret...
84009b489b3969e03a8f39075818ee1d874f3042b594bdf033a8ed38dca4715d
# Licensed under a 3-clause BSD style license - see LICENSE.rst CONTACT = "Michael Droettboom" EMAIL = "mdroe@stsci.edu" import io from os.path import join import os.path import shutil import sys from distutils.core import Extension from distutils.dep_util import newer_group from astropy_helpers import setup_helpe...
faea432f172953f216c5cd889ea0aa5ae943460adea4d4360d0df48935492bc1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from .. import units as u from .wcs import WCS, WCSSUB_CELESTIAL __doctest_skip__ = ['wcs_to_celestial_frame', 'celestial_frame_to_wcs'] __all__ = ['add_stokes_axis_to_wcs', 'celestial_frame_to_wcs', 'wcs_to_celestial_fra...
687f6500bb8853d61bfd95e99f92cacccb159e218af3efc6e1dadca5283b5622
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Under the hood, there are 3 separate classes that perform different parts of the transformation: - `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS functionality in `wcslib`_. (This includes TPV and TPD polynomial distortion, b...
b8e6f496bdc83e1cb70f3f25768e7f79529c88fb3b68d172ed4930a098838ea8
# Licensed under a 3-clause BSD style license - see LICENSE.rst # It gets to be really tedious to type long docstrings in ANSI C # syntax (since multi-line string literals are not valid). # Therefore, the docstrings are written here in doc/docstrings.py, # which are then converted by setup.py into docstrings.h, which ...
50bf4573c518b9a1b1ab74cd7341b285efbd06f2fef45f2395a3af90ca47e715
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.time package provides functionality for manipulating times and dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in astr...
a3c5e37f7199380d0243f348fc06b5553214b7a71a429636412c8f77f9f03ec0
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .formats import * from .core import *
ee3290b62e1ef54c315362e5d6e336dabb108d3b3044cbee9a54e14cfb1e782a
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Time utilities. In particular, routines to do basic arithmetic on numbers represented by two doubles, using the procedure of Shewchuk, 1997, Discrete & Computational Geometry 18(3):305-363 -- http://www.cs.berkeley.edu/~jrs/pape...
010f5ae304e453501cb5889f35faac8aca55953fe720522f260e2574686c1e37
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import fnmatch import time import re import datetime from collections import OrderedDict, defaultdict import numpy as np from ..utils.decorators import lazyproperty from .. import units as u from .. import _erfa as erfa from .uti...
f70d081b536f685fd13fe69b0eeffefdd97407ca466efe657d93fd71eeab769c
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['quantity_input'] import inspect from ..utils.decorators import wraps from ..utils.misc import isiterable from .core import Unit, UnitsError, add_enabled_equivalencies from .physical import _unit_physical_mapping def...
6788ec87c476eae976198a64ffa49cc009095c8f147dcf3d97c2ee5e020db45d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines colloquially used Imperial units. They are available in the `astropy.units.imperial` namespace, but not in the top-level `astropy.units` namespace, e.g.:: >>> import astropy.units as u >>> mph = u...
ab0750b6b603468d21f9302ee9d542964a9b329a68985b6d9c9889cdf04fd830
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines units used in the CDS format, both the units defined in `Centre de Données astronomiques de Strasbourg <http://cds.u-strasbg.fr/>`_ `Standards for Astronomical Catalogues 2.0 <http://cds.u-strasbg.fr/doc/ca...
6bc080b4767391365d78381917a9a9977a5de63909c656fa7686af3c90a53581
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # The idea for this module (but no code) was borrowed from the # quantities (http://pythonhosted.org/quantities/) package. """Helper functions for Quantity. In particular, this implements the logic that determines scaling and resul...
7a831eaa86e8cfcfc12cf3862bafcb3ae4b168950c7d61dcd365577744da5796
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Core units classes and functions """ import inspect import operator import textwrap import warnings import numpy as np from ..utils.decorators import lazyproperty from ..utils.exceptions import AstropyWarning from ..utils.m...
b9c21d05b91041941137420d546ad8e7662543c8e876163c164a1fbfe7a3b85a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different physical units. This code is adapted from the `pynbody <https://github.com/pynbody/pynbody>`_ units module written by Andrew Pontzen, who has granted the Ast...
5150bf1925ed74c36f8610b5a7d9248655995468b75889200fcc501e93e0d314
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the astrophysics-specific units. They are also available in the `astropy.units` namespace. """ from . import si from ..constants import si as _si from .core import (UnitBase, def_unit, si_prefixes, binar...
b51df8024d38d6753c46210c340641005da690ad54737e6ff6aac55afaff16b0
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Defines physical unit names. This module is not intended for use by user code directly. Instead, the physical unit name of a `Unit` can be obtained using its `ptype` property. """ from . import core from . import si from . ...
912cf6d1104ff23ab398a28eb3c6a74d60733e05fdd649603a6aaad7930fa3d9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Miscellaneous utilities for `astropy.units`. None of the functions in the module are meant for use outside of the package. """ import numbers import io import re from fractions import Fraction import numpy as np from numpy import finfo _float_fi...
7b8da1ec271399651d2059db06f63125d185cab8010bd3d4fcac3ad7c0089824
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines the `Quantity` object, which represents a number with some associated units. `Quantity` objects support operations like ordinary numbers, but will deal with unit conversions internally. """ # Standard libra...
a1094edb71bd0130c16b3df31ee6148ba85165dbb06ee16b467627149dc4db06
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the SI units. They are also available in the `astropy.units` namespace. """ from ..constants import si as _si from .core import UnitBase, Unit, def_unit import numpy as _numpy _ns = globals() ########...
54883c28ada7e386c882b4e18bc6726bf2a8292ccefc473eb7f13af21a71dd35
# Licensed under a 3-clause BSD style license - see LICENSE.rst """A set of standard astronomical equivalencies.""" # THIRD-PARTY import numpy as np import warnings # LOCAL from ..constants import si as _si from . import si from . import cgs from . import astrophys from .function import units as function_units from ....
48921bf628672772221f1eca1d7ef60f1adbd10d05570acc3585cea35228e72a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains convenience functions for retrieving solar system ephemerides from jplephem. """ from urllib.parse import urlparse from collections import OrderedDict import numpy as np from .sky_coordinate import SkyCoord from ..utils.data imp...
cb0e4d2b6ca097da8d53f9ff3afe57e2e43f9ffa4acd1699cb4a28e3c5e16d3c
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst ''' This module defines custom errors and exceptions used in astropy.coordinates. ''' from ..utils.exceptions import AstropyWarning __all__ = ['RangeError', 'BoundsError', 'IllegalHourError', 'IllegalMinuteError', 'Ill...
fb19f5cdbb75298b33439af8e94a135134ae1d9e92196ba74e3f6d2426431131
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains utililies used for constructing rotation matrices. """ from functools import reduce import numpy as np from .. import units as u from .angles import Angle def matrix_product(*matrices): """Matrix mul...
3127ebca0d0d42515657270590cef55fc0315a4aaab0e94e32efcc78b4e8f609
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for celestial coordinates of astronomical objects. It also contains a framework for conversions between coordinate systems. """ from .errors import * from .angles import * from .baseframe import * from ....
ee22ee7b96b8f340053f77c7ccee92c9cec20fe4c0baa0e79e0f9a19bfe32bce
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions for matching coordinate catalogs. """ import numpy as np from .representation import UnitSphericalRepresentation from .. import units as u from . import Angle __all__ = ['match_coordinates_3d', 'match_coordinates_sky'...
3dcb5ca4341829e4859d1daa2f1dc755c63f0183514e5031e9fed841a2118fc6
import re import copy import warnings import collections import numpy as np from .. import _erfa as erfa from ..utils.compat.misc import override__dir__ from ..units import Unit, IrreducibleUnit from .. import units as u from ..constants import c as speed_of_light from ..wcs.utils import skycoord_to_pixel, pixel_to_...
3d57bd82039526075c5eadcc77189cb2da0f1f123527ecd81ac945b636f65877
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst _tabversion = '3.8' _lextokens = set(('UINT', 'SIMPLE_UNIT', 'DEGREE', 'MINUTE', 'HOUR', 'COLON', 'UFLOAT', 'SIGN', 'SECOND')) _lexreflags = 0 _lexliterals = '' _lexstateinfo = {'INITIAL': 'inclusive'} _lexstatere = {'INI...
f13b284e1b4af4b5f637e038a57a4161a37c203f8fa67fd8b725c21bc19d50d3
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Currently the only site accessible without internet access is the Royal Greenwich Observatory, as an example (and for testing purposes). In future releases, a canonical set of sites may be bundled into astropy for when the online registry is unavailab...
fcac04cd6c40af0e586bd6d5d8f1e744ac0f97d33b04512caefa95058b693acd
""" In this module, we define the coordinate representation classes, which are used to represent low-level cartesian, spherical, cylindrical, and other coordinates. """ import abc import functools import operator from collections import OrderedDict import inspect import warnings import numpy as np import astropy.uni...
23826b6f9965ffcd5d2e49544acc399d0aa689f430bb4a418a451a1793c4abc2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains convenience functions for getting a coordinate object for a named object by querying SESAME and getting the first returned result. Note that this is intended to be a convenience, and is very simple. If you need precise coordinates...
445cd520bccd61624a756d53330807513bfbb48cbba0715cb0c2f3bcb8be6172
# -*- coding: utf-8 -*- # 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...
d7d904bfe5c982549f608d285422f0f7e71cff82a36979dca6980bea9e5def1c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains a general framework for defining graphs of transformations between coordinates, suitable for either spatial coordinates or more generalized coordinate systems. The fundamental idea is that each class is a node in the transformati...
dedea3bb4b2d2fe07615730d26ab075fbd3d026d2216b15e0c2855afc11427fe
# Licensed under a 3-clause BSD style license - see LICENSE.rst def get_package_data(): return {'astropy.coordinates.tests.accuracy': ['*.csv'], 'astropy.coordinates': ['data/*.dat', 'data/sites.json']}
798809da668b19516dad126da8e91cd0929855535ce5c79eef2b3331ba85e8a4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the classes and utility functions for distance and cartesian coordinates. """ import numpy as np from .. import units as u from .angles import Angle __all__ = ['Distance'] __doctest_requires__ = {'*': ['scipy.integrate']} c...
a5a361ccbc7e2e74fc6aaf2c39abf96adb1bfe38aa9fa31b11f95dcc1596748b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains convenience functions for coordinate-related functionality. This is generally just wrapping around the object-oriented coordinates framework, but it is useful for some users who are used to more functional interfaces. """ impor...
5f9f0e7a9d235aab16ed512b231e5ff1999418823991f61a2167ff5299f2c155
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Framework and base classes for coordinate frames/"low-level" coordinate classes. """ # Standard library import abc import copy import inspect from collections import namedtuple, OrderedDict, defaultdict import warnings # Depe...
3dfd36d3b798b8196bea52e498dc572042160f5394b27bfad9f0a199f3f9fad7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains convenience functions implementing some of the algorithms contained within Jean Meeus, 'Astronomical Algorithms', second edition, 1998, Willmann-Bell. """ import numpy as np from numpy.polynomial.polynomial import polyval from .....
7ee98ad08bbf2679c3662425250d601b7c56b343d8b91a44d09e04d1f6fa0229
# Licensed under a 3-clause BSD style license - see LICENSE.rst from warnings import warn import collections import socket import json import urllib.request import urllib.error import urllib.parse import numpy as np from .. import units as u from .. import constants as consts from ..units.quantity import QuantityInfo...
686ce540769fad2b1a4d0964f1b44dbe442c3abbd1e33b6a04cb24c7c45c481c
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the fundamental classes used for representing coordinates in astropy. """ import math from collections import namedtuple import numpy as np from . import angle_utilities as util from .. import units as u...
ea3763baa66f3ea363789f5390e0b219cd66e715b0744f58435d2bf82dfcdb24
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # Dependencies import numpy as np import warnings # Project from .. import units as u from ..utils.exceptions import AstropyDeprecationWarning from ..utils import OrderedDescriptor, ShapedLikeNDArray __all__ = ['Attribute', 'Tim...
ebb3001f081675aef04ce751a07b39b47c3b37829dfa22e3e6b8a3fdbb114c3d
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # Standard library import re import textwrap from datetime import datetime from xml.dom.minidom import parse from urllib.request import urlopen # Third-party from .. import time as atime from ..utils.console import color_print, _...
31e08749c83acd528b0774e877277ff0f157efc03be09a216ab606b230565a29
# 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 = 'DA395940D76FFEB6A68EA2DB16FC015D' _lr_action_items = {'UINT':([0,2,10,12,19,20,22,23,35,36,38,],[-7,12,-6,19,25,27,29,32,25,25,25,]),'MIN...
4df7ad700321b972abef569f9d60b3dc0c29bbcf946c8c719f2f0d00ae158731
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains standard functions for earth orientation, such as precession and nutation. This module is (currently) not intended to be part of the public API, but is instead primarily for internal use in `coordinates` """ import numpy as np ...
84a7e9c91a3eedcecd8a48690673cd4212459d94a6582cfc2004a3b23e367580
# Licensed under a 3-clause BSD style license - see LICENSE.rst import contextlib import pathlib import re import sys from collections import OrderedDict from operator import itemgetter import numpy as np __all__ = ['register_reader', 'register_writer', 'register_identifier', 'identify_format', 'get_re...
3514095323b3408a50df99f844f2b1a0a82a8ad14728f0e62e08263a1fbaf3a3
""" Implements the wrapper for the Astropy test runner in the form of the ``./setup.py test`` distutils command. """ import os import glob import shutil import subprocess import sys import tempfile from setuptools import Command class FixRemoteDataOption(type): """ This metaclass is used to catch cases whe...
73cb84d9665a83ab4af90e18393e507d75a9f66c47b2ba17b2ba12d8de22c505
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module is included only for backwards compatibility. Packages that want to use these variables should now import them directly from `astropy.tests.plugins.display` (although eventually it may be possible to configure them within setup.cfg). TODO:...
2a7784b155ea6b5268bd954bb46cf5da42f5de95b7d967f44fdd3aed5bc97483
# Licensed under a 3-clause BSD style license - see LICENSE.rst import importlib import sys import warnings import pytest from .helper import catch_warnings from .. import log from ..logger import LoggingError, conf from ..utils.exceptions import AstropyWarning, AstropyUserWarning # Save original values of hooks....
405ccccf29369ba6b8d77a86add0590980e6dc66c9feba4317118fa49c554ebf
"""Implements the Astropy TestRunner which is a thin wrapper around py.test.""" import inspect import os import glob import copy import shlex import sys import tempfile import warnings import importlib from collections import OrderedDict from importlib.util import find_spec from ..config.paths import set_temp_config,...
2a115ddce0861b7f2083906e13be2b5e3ad38bc42614db852ff9aada7443ce45
# Licensed under a 3-clause BSD style license - see LICENSE.rst def get_package_data(): return { 'astropy.tests': ['coveragerc'], }
2b1018b9248842d86917337db9a73f1c3a0c0ddbe988ec73fb901a314444ccb1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides the tools used to internally run the astropy test suite from the installed astropy. It makes use of the `pytest` testing framework. """ import os import sys import types import pickle import warnings import functools import pyte...
129c37a6211e764d0ee0173f0b05cdb162d59169cff4e3e9c2ac0f997ed64694
import matplotlib from matplotlib import pyplot as plt from ..utils.decorators import wraps MPL_VERSION = matplotlib.__version__ ROOT = "http://{server}/testing/astropy/2018-02-01T23:31:45.013149/{mpl_version}/" IMAGE_REFERENCE_DIR = ROOT.format(server='data.astropy.org', mpl_version=MPL_VERSION[:3] + '.x') def i...
764720ca5eb566100d7c4ab7a6cf4e6bd965521d1e16e6632c150dc5aa28e703
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is retained only for backwards compatibility. Affiliated packages should no longer import ``disable_internet`` from ``astropy.tests``. It is now available from ``pytest_remotedata``. However, this is not the recommended mechanism for controlling a...
5c96aae81722034e1a5cd7e3a62430c52febcedf052d6fd426b26154778928c4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants in SI units. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import numpy as np from .constant import Constant # ASTRONOMICAL CONSTANTS class IAU2012(Constant): defau...
d7151215de768d393c09a4b5abe77239df6b075f660ed38ad7fcfc16022c002b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants in SI units. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import numpy as np from .constant import Constant, EMConstant # PHYSICAL CONSTANTS class CODATA2014(Constant)...
8422048da6508d633e96dcbc4b116a79cd1be82ac05af650dcf9749cf5c0aa6b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains astronomical and physical constants for use in Astropy or other places. A typical use case might be:: >>> from astropy.constants import c, m_e >>> # ... define the mass of something you want the rest energy of as m ... >>> m = m_...
a98708e9b40932300529e6ff8b9ce0bbf6df894ddc9c3d9ffdeacbe62a3c7152
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants in SI units. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import numpy as np from .constant import Constant, EMConstant # PHYSICAL CONSTANTS class CODATA2010(Constant)...
9547dcedb4c8e705412c4dc9900c379a5ce9218ded7bc87daee2eea7c29df6e4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants for Astropy v1.3 and earlier. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import inspect from . import utils as _utils from . import codata2010, iau2012 _utils._set_c(coda...
8160b661c19685069d4c326fea1e9091605a79ffdc67957f4f1ffc25afb0e1bb
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants in SI units. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import numpy as np from .constant import Constant from .codata2014 import G # ASTRONOMICAL CONSTANTS class IA...
3c887bb764ca200aa1a037c7c5dc08a14aa209badd24b86081a8b2bd59f9e82d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants for Astropy v2.0. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import inspect from . import utils as _utils from . import codata2014, iau2015 _utils._set_c(codata2014, iau...
23da9068839b5173829f67bfb88de75bf61fd418e7e85421f8c6d9393393c537
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Utility functions for ``constants`` sub-package.""" import itertools __all__ = [] def _get_c(codata, iaudata, module, not_in_module_only=True): """ Generator to return a Constant object. Parameters ---------- codata, iaudata : ob...