hash
stringlengths
64
64
content
stringlengths
0
1.51M
38130b17f976bb6e9362cab7c0b3b3194c6644a357928a4401fd5a46c34d13c7
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file is the main file used when running tests with pytest directly, # in particular if running e.g. ``pytest docs/``. import os import tempfile import hypothesis from astropy import __version__ try: from pytest_astropy_header.display import...
bded93adc301a0fcc3dd01dc4f3e259ca71231cc421fd7bee8443d206b1ce143
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst # NOTE: The configuration for the package, including the name, version, and # other information are set in the setup.cfg file. import sys # First provide helpful messages if contributors try and run legacy commands # for tests or d...
73b018608b35beb850df948ebe0315cbe4f8019618c62ccea33612d1f828bdf7
import os import shutil import sys import erfa # noqa import pytest import astropy # noqa if len(sys.argv) == 3 and sys.argv[1] == '--astropy-root': ROOT = sys.argv[2] else: # Make sure we don't allow any arguments to be passed - some tests call # sys.executable which becomes this script when producing...
f3a0aeb97076b413c5b12bf54c9d21687bfae4f546d809811d8fd5110a7aa5eb
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astropy is a package intended to contain core functionality and some common tools needed for performing astronomy and astrophysics research with Python. It also provides an index for other astronomy packages and tools for managing them. """ import os ...
ab94da6ed51f8e247cb5bf4f29bd54aa85a12e98494aebf149298826f5daa769
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module defines a logging class based on the built-in logging module. .. note:: This module is meant for internal ``astropy`` usage. For use in other packages, we recommend implementing your own logger instead. """ import inspect import ...
849d26898fd469a494890a464c47e1076f6d55df28b54c2619cc895ab57340d1
# NOTE: First try _dev.scm_version if it exists and setuptools_scm is installed # This file is not included in astropy wheels/tarballs, so otherwise it will # fall back on the generated _version module. try: try: from ._dev.scm_version import version except ImportError: from ._version import ver...
e3970894c3f13086681508803f5f44c92c2fd9b69c5f237606b04099de0ac0dd
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains pytest configuration settings that are astropy-specific (i.e. those that would not necessarily be shared by affiliated packages making use of astropy's test runner). """ import builtins import os import sys import tempfile import wa...
b083f49c5a623cf28e75b25cd79688276dbe7ed19355a301169da9235586360e
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file needs to be included here to make sure commands such # as ``pytest docs/...`` works, since this # will ignore the conftest.py file at the root of the repository # and the one in astropy/conftest.py import os import tempfile import pytest # M...
6f600f3b21fec07e8bd0aecdf780f73a4b028ba7cacacb37ef41fecbcb1b874f
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this file. # # All configurati...
c07338c94a815b26b8846754da892de4c0e1b22dde30525e9980609aeaba4861
# NOTE: this hook should be added to # https://github.com/pyinstaller/pyinstaller-hooks-contrib # once that repository is ready for pull requests from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('skyfield')
bfa48512aada02006c25f249d8b46593f5a541cd7244d7f675f740dab06a9099
# -*- coding: utf-8 -*- """ ======================== Title of Example ======================== This example <verb> <active tense> <does something>. The example uses <packages> to <do something> and <other package> to <do other thing>. Include links to referenced packages like this: `astropy.io.fits` to show the astro...
547790e0143fe9a8b1996e4cecd461eb313bd82630ddb4630845753fd1343eef
# -*- coding: utf-8 -*- r""" ========================================================== Create a new coordinate class (for the Sagittarius stream) ========================================================== This document describes in detail how to subclass and define a custom spherical coordinate frame, as discussed in...
169d08766b27d0e8c3edf0512170a6796246d917db295c0b3463aa7bfb1c4330
# -*- coding: utf-8 -*- """ ================================================================ Convert a radial velocity to the Galactic Standard of Rest (GSR) ================================================================ Radial or line-of-sight velocities of sources are often reported in a Heliocentric or Solar-syst...
9035692fe1ca2a75b94864183c99f6dfb14e7c446c8fa7bdbb53ec46b965569a
# -*- coding: utf-8 -*- """ ======================================================================== Transforming positions and velocities to and from a Galactocentric frame ======================================================================== This document shows a few examples of how to use and customize the `~ast...
12bef7dc219d41692d2cbc9fe75a49900ea1f0df6e831e5d70e413d075a0fb12
# -*- coding: utf-8 -*- """ =================================================================== Determining and plotting the altitude/azimuth of a celestial object =================================================================== This example demonstrates coordinate transformations and the creation of visibility cur...
fbb510c5e0186d5e16961c613d3831dbd37a4d215fe262121af70c4b3d053210
# -*- coding: utf-8 -*- """ ================== Edit a FITS header ================== This example describes how to edit a value in a FITS header using `astropy.io.fits`. *By: Adrian Price-Whelan* *License: BSD* """ from astropy.io import fits #####################################################################...
f060aa9837a0df597dbb32aa17d9db8fda514facc6f269012d3fc9611751b903
# -*- coding: utf-8 -*- """ ===================================================== Create a multi-extension FITS (MEF) file from scratch ===================================================== This example demonstrates how to create a multi-extension FITS (MEF) file from scratch using `astropy.io.fits`. *By: Erik Bray*...
f8e82631004deaaab5e0800e207f27d16652fb1494aaeb6bec42c040fe4f5c35
# -*- coding: utf-8 -*- """ ===================================================================== Accessing data stored as a table in a multi-extension FITS (MEF) file ===================================================================== FITS files can often contain large amount of multi-dimensional data and tables. T...
78cf5c60f74125abbfa26c0a951f75863b38c484d06ca630714937cedada6e19
# -*- coding: utf-8 -*- """ ======================================= Read and plot an image from a FITS file ======================================= This example opens an image stored in a FITS file and displays it to the screen. This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open th...
042abe04a704fa7bcd949b1e95727d07e411096873c00d61d30b3d539d20354a
# -*- coding: utf-8 -*- """ ========================================== Create a very large FITS file from scratch ========================================== This example demonstrates how to create a large file (larger than will fit in memory) from scratch using `astropy.io.fits`. *By: Erik Bray* *License: BSD* """...
93f258becc4ec5da3768b6fd02d801854a4cb29f419856cfe08914b80cd312c8
# -*- coding: utf-8 -*- """ ===================================================== Convert a 3-color image (JPG) to separate FITS images ===================================================== This example opens an RGB JPEG image and writes out each channel as a separate FITS (image) file. This example uses `pillow <htt...
39925d73352c68f7255c1d0d924280ef6398a56b59b5ccb3c0347e3e2b53f09f
# 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...
a671682046f0a87fb4fee08f99dc39dc03225cc8bc17033841e75048b23dbe9d
# -*- 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 astropy.constants import si as _si from .core import (UnitBase, def_unit, si_prefixes,...
0b2781faaca6b6933abaa13f2824ea15230bbd10fdeb9f957443315a055f1d91
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Support for ``typing`` py3.9+ features while min version is py3.8. """ from typing import * try: # py 3.9+ from typing import Annotated except (ImportError, ModuleNotFoundError): # optional dependency try: from typing_extensions imp...
46d21d999a60a43886c5596edc5958a66299b51124ae7af43c8397e3ab1ac805
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Defines the physical types that correspond to different units.""" import numbers import warnings from . import core from . import si from . import astrophys from . import cgs from . import imperial # Need this for backward namespace compat, see issu...
993c714f2008288a714601027ad005de4d23245e3e460918c66069eb7966a3f1
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines miscellaneous units. They are also available in the `astropy.units` namespace. """ from . import si from astropy.constants import si as _si from .core import (UnitBase, def_unit, si_prefixes, binary_prefi...
010acb8739268afb39b57f68a20f26d00f041fc45ee6f0591da35fd4805716f5
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines SI prefixed units that are required by the VOUnit standard but that are rarely used in practice and liable to lead to confusion (such as ``msolMass`` for milli-solar mass). They are in a separate module from...
98d90b12739822c658236023dbfa4ba1e70bcecfe2b6c8ce4758d9dac28d0ff6
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the CGS units. They are also available in the top-level `astropy.units` namespace. """ from fractions import Fraction from . import si from .core import UnitBase, def_unit _ns = globals() def_unit(['c...
803f838d8eb7c8a0c705c85801a5d3a7910d261cd3ec6b0c93f820d7a20e9f56
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines deprecated units. These units are not available in the top-level `astropy.units` namespace. To use these units, you must import the `astropy.units.deprecated` module:: >>> from astropy.units import dep...
798e04161d76df505a2134d2a0639c178eeb668445a39d09c62316f3f6122d68
# 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 io import re from fractions import Fraction import numpy as np from numpy import finfo _float_finfo = finfo(float...
6e22b6f296084fcb81cf2a1e4acd1bbb4aa695238cf7a9cee400daa246530a39
# -*- 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...
da2c0c67aa0ef24cf668a71f1e193d77284f17db328cafe168a9477cec0b0494
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines structured units and quantities. """ # Standard library import operator import numpy as np from .core import Unit, UnitBase, UNITY __all__ = ['StructuredUnit'] DTYPE_OBJECT = np.dtype('O') def _names...
9665f54dbb8af288bd88ee6f2c2320e696aaf7df49826bfbd45b255a44782732
# -*- 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://vizier.u-strasbg.fr/viz...
b7eb194e81a6fa696fa02e0d473040aa4a8081a84082d9f7696d577596c75616
# 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 astropy.utils.decorators import lazyproperty from astropy.utils.exceptions import AstropyWarning from astropy.utils.misc im...
371fafa4888342a351cf03ba1364af408b431c316fa826efc66ab9ead0f5a738
# -*- 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 astropy.constants import si as _si from .core import UnitBase, Unit, def_unit import numpy as _numpy _ns = globals() ##...
538a507c81dd48451201514cf90b447e6712ca63b6aa4d962c08bcf52642b898
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines magnitude zero points and related photometric quantities. The corresponding magnitudes are given in the description of each unit (the actual definitions are in `~astropy.units.function.logarithmic`). """ ...
0061167b3e4bd1f6fb17d8d99978a1e33af18cbfab566d5b5f3324597cd0cc4a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """A set of standard astronomical equivalencies.""" from collections import UserList # THIRD-PARTY import numpy as np import warnings # LOCAL from astropy.constants import si as _si from astropy.utils.exceptions import AstropyDeprecationWarning from ast...
5538c71dc43926cfd96507025b7e399519cdaff9d82bcc31c119b191143119e0
# -*- 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...
9a61460dce45f518dd4677b45d10e22c226fdb31db18829988e4958e6d6a6a54
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['quantity_input'] import inspect from numbers import Number from collections.abc import Sequence from functools import wraps import numpy as np from . import _typing as T from .core import (Unit, UnitBase, UnitsError,...
4842380e631836dca31c470023e22df4513f2eaa975e1608e79fa7d5cb0891ed
# 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...
ac8cd0f1c0ff0084933fc0a15b99db05ce918df64d6318ba9d53698032d3dcdc
# 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 ...
1c02db8bbce4cea4d85471b4eb1670b878c58d89eda7657a41d8a965666547a7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements a class based on NDData with all Mixins. """ from .nddata import NDData from .mixins.ndslicing import NDSlicingMixin from .mixins.ndarithmetic import NDArithmeticMixin from .mixins.ndio import NDIOMixin __all__ = ['NDDataRef...
ba335620567022c3e090cfde84c671c4d0b7b2a86a9f15b06b6fb83ccee5f96f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module includes helper functions for array operations. """ import numpy as np from .decorators import support_nddata __all__ = ['reshape_as_blocks', 'block_reduce', 'block_replicate'] def _process_block_inputs(data, block_size): data = np...
530e7aa46b684a9311378124bd8530b93460f350a15acb12dcfdd74ffd8c7b1c
# 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 astropy import units as u from astropy.coordinates import SkyCoord from astropy.utils import lazyproperty from astropy.wcs.utils import...
2a3550cc52868c9b3e9599bb19101dd009351ef68f544fe09eb19ce6ec3c1c49
# 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 astropy.units import UnitsError, UnitConversionError, Unit from astropy import log from .nddata import NDData from .nduncertainty import NDUncertainty from .mixins.nd...
907cde2f5c369e53db847bc491a8851c83631d4ed7b772638c9ffa6706736821
""" A module that provides functions for manipulating bit masks and data quality (DQ) arrays. """ import warnings import numbers from collections import OrderedDict import numpy as np __all__ = ['bitfield_to_boolean_mask', 'interpret_bit_flags', 'BitFlagNameMap', 'extend_bit_flag_map', 'InvalidBitFlag'] ...
a652c11af8c77636655f20b94eb3eee2f33077e19981a9ca2202fb6ad2b3efac
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module implements the base CCDData class.""" import itertools import numpy as np from .compat import NDDataArray from .nduncertainty import ( StdDevUncertainty, NDUncertainty, VarianceUncertainty, InverseVariance) from astropy.io import fits...
18876075cd3805976c17b2d3df95dc03fdc9190bb87669f7d4d3106d28f55ea4
# 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 astropy import log from astropy.units import Unit, Quantit...
ff59883f22824c331420b9264d4b127e61a4f98e8868562aef3a7eedf1c0455b
# Licensed under a 3-clause BSD style license - see LICENSE.rst from collections import OrderedDict import numpy as np from astropy.utils.misc import isiterable __all__ = ['FlagCollection'] class FlagCollection(OrderedDict): """ The purpose of this class is to provide a dictionary for containing arra...
07114ad1ca82fdc4b4525fe065d85d344a7b6b7e245d8e74545cb1e08cb5df54
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing utilities. Not part of the public API!""" from astropy.wcs import WCS from astropy.wcs.wcsapi import BaseHighLevelWCS def assert_wcs_seem_equal(wcs1, wcs2): """Just checks a few attributes to make sure wcs instances seem to be equal. ...
7e668bae4f20258a9698f2b39e14f5cec0a4e6266290b947aeb0c0867defa288
# 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 functools import wraps from astropy.utils.exceptions import AstropyUserWarning from .nddata import NDData __all__ = ['support_nddata'] # All su...
755afc3ac9cc3be9170ce9c36829012d03dbfc1bf5015cd6d8fdb903c867607c
# 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 astropy.utils.compat import ignored from astropy import log from astropy.units import Unit, Quantity, UnitConversionError __all__ = ['MissingData...
c6905a0e821ad74b5c19dfa4118df045377ec4aa77fb30132794e045e895edbe
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import warnings from astropy.cosmology import units as cu from astropy.io import registry as io_registry from astropy.units import add_enabled_units from astropy.utils.exceptions import AstropyUserWarning __all__ = ["CosmologyRead", "Cosmolo...
74bcdc4e801627cb6d98839998bf856bb6c6b1a556cdab7315493169e132d998
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ astropy.cosmology contains classes and functions for cosmological distance measures and other cosmology-related calculations. See the `Astropy documentation <https://docs.astropy.org/en/latest/cosmology/index.html>`_ for more detailed usage examples a...
a563c44ea373606c2aa93c54655c2c69444c59dea5b4678d57d02e363f4b431e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings from abc import abstractmethod from math import acos, cos, exp, floor, inf, log, pi, sin, sqrt from numbers import Number import numpy as np import astropy.constants as const import astropy.units as u from astropy.utils.compat.optional_d...
e49231749ad552e062197ebbba862da1c031a01008ec76d5c0a6af792afaf50b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains dictionaries with sets of parameters for a given cosmology. Each cosmology has the following parameters defined: ========== ===================================== Oc0 Omega cold dark matter at z=0 Ob0 O...
725c8903b83c94a766cea2c7f666157b3547c8eac417ec10d93a757730166298
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """Cosmological units and equivalencies. """ # (newline needed for unit summary) import astropy.units as u from astropy.units.utils import generate_unit_summary as _generate_unit_summary __all__ = ["littleh", "redshift", ...
5a6310e2fe97f6e9a446fe4f52ca0b538260e9689927ed6104d3a303a1406145
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import pathlib import sys # LOCAL from astropy.utils.data import get_pkg_data_path from astropy.utils.decorators import deprecated from astropy.utils.state import ScienceState from .core import Cosmology _COSMOLOGY_DATA_DIR = pathlib.Path(get...
0cf697f9e13d46cb19ec2fcefcaeb5fa9783a44383a4a3f6f84010f6b5a099dd
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools from math import inf from numbers import Number import numpy as np from astropy.units import Quantity from astropy.utils import isiterable from astropy.utils.decorators import deprecated from . import units as cu __all__ = [] # nothi...
af167934d42107f854842b239855a5ae9899fd37e66c52fbcfb05dca24a053ff
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc import functools import inspect from types import FunctionType, MappingProxyType import numpy as np import astropy.units as u from astropy.io.registry import UnifiedReadWriteMethod from astropy.utils.decorators import classproperty from astro...
359ff16a32d960f853bcbe1012d4994b8646a21467e97ff1d3d089707f5331a1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import astropy.units as u from astropy.utils.decorators import classproperty __all__ = ["Parameter"] class Parameter: r"""Cosmological parameter (descriptor). Should only be used with a :class:`~astropy.cosmology.Cosmology` subclass. Para...
6c5f2c742ebd1b3237e201af83be58da5518b507dd607abe6ae185575e72ad98
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Convenience functions for `astropy.cosmology`. """ import warnings import numpy as np from astropy.units import Quantity from astropy.utils.exceptions import AstropyUserWarning from . import units as cu from .core import CosmologyError __all__ = [...
089651864317bba25e07875b72e9a461233662cb29a69224b2a40a6609639bb8
# 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_...
9a3dea90e2172c28bbc5a2eb2695408d7594a87f2a3dea949b2c21eda17b3926
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Configures the codata and iaudata used, possibly using user configuration. """ # Note: doing this in __init__ causes import problems with units, # as si.py and cgs.py have to import the result. import importlib import astropy phys_version = astropy.p...
b0178bb8388a3015d0974ce61b2fe5bf201adea6495584ade50f10ab30540c78
# 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. """ from astropy.utils import find_current_module from . import codata2010, iau2012 from . import uti...
962480a7a67d3204612f2c04dc495749b714fd32724ba9c8beea205bcbff4961
# 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):...
bcbc46772575b503a3faf8cbff3d5bbcff77ca65a48021cb1c36552ae5ab0373
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants for Astropy v4.0. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import warnings from astropy.utils import find_current_module from . import codata2018, iau2015 from . impor...
b039f90e668a1e39fdf5c494c7274c2beefaa71499ee7dd66f7d5b051d0a1a6c
# 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 .config import codata from .constant import Constant # ASTRONOMICAL CONSTANTS class I...
72b4dd0198b2a91b998465ebd1f7f7dd57e2724af501ee3fe91131f0fab930ac
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astronomical and physics constants in cgs units. See :mod:`astropy.constants` for a complete listing of constants defined in Astropy. """ import itertools from .config import codata, iaudata from .constant import Constant for _nm, _c in itertools.ch...
2b052e76622356a4fb1d7bb817a70f3191e445a7cb445f94d90ea01556079572
# 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...
88f385a7cb4c00df5cd822b50da19f8f261818590511e060e06009f3e48221a5
# 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 warnings from astropy.utils import find_current_module from . import codata2014, iau2015 from . impor...
185b5aa991e83f454530c0e08b0d3349a67b22157b508e9098d1d0d3bd834749
# 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...
00c41d4824c990c4eb4e3ce78c573bb001c0835bddee0dfd3c55fbcbe31883c3
# 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 math from .constant import Constant, EMConstant # PHYSICAL CONSTANTS # https://en.wikipedia.org/wiki/2019...
9be6c25ddb4036b8127c2a045df1fb9f648f769af80e0c0b357549445ca6d986
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import types import warnings import numpy as np from astropy.units.core import Unit, UnitsError from astropy.units.quantity import Quantity from astropy.utils import lazyproperty from astropy.utils.exceptions import AstropyUserWarning ...
fd79b52eba117c7394745dc90764d9b527072abba1fd56f786b1d32527a232af
# 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):...
976ff12fa11e050043c7801f3a4cb51982819dfaa6e5ba50cab1302bf7277924
# 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 itertools from .config import codata, iaudata from .constant import Constant for _nm, _c in itertools.cha...
632176446a2d126e44536efde415c8afe681d88ecb99aab614a2142a5ebb5b60
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.io import registry from .info import serialize_method_as __all__ = ['TableRead', 'TableWrite'] __doctest_skip__ = ['TableRead', 'TableWrite'] class TableRead(registry.UnifiedReadWrite): """Read and parse a data table and return as a T...
9f55f5b6c001ac7b387648d082eaf005e29735058b770c5ccbea1720f1fb5642
# Licensed under a 3-clause BSD style license - see LICENSE.rst import astropy.config as _config from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo __all__ = ['BST', 'Column', 'ColumnGroups', 'ColumnInfo', 'Conf', 'JSViewer', 'MaskedColumn', 'NdarrayMixin', 'QTable', 'Row', ...
c7a43c550ca093c289825e09947505b08851e8ed59f33d5e4b4baa243433acc7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Helper functions for table development, mostly creating useful tables for testing. """ from itertools import cycle import string import numpy as np from .table import Table, Column from astropy.utils.data_info import ParentDtypeInfo class TimingT...
4b83259e6207d52d8d9b693d36812f8c57b56e520ae8e00263d32e7baa712a94
""" Table property for providing information about table. """ # Licensed under a 3-clause BSD style license - see LICENSE.rst import sys import os from contextlib import contextmanager from inspect import isclass import numpy as np from astropy.utils.data_info import DataInfo __all__ = ['table_info', 'TableInfo', 'se...
ef336ec0932a28b8b9b88157706988ce3b213d6c365c2299e9bf4a64a0ef5be7
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import warnings import weakref from copy import deepcopy import numpy as np from numpy import ma from astropy.units import Unit, Quantity from astropy.utils.console import color_print from astropy.utils.metadata import MetaData from as...
8fbc137607dd786544e5b6eb12cd9c5af4315a5e24d3c71e1b17423a1110cc47
# Licensed under a 3-clause BSD style license - see LICENSE.rst import collections from collections import OrderedDict from operator import index as operator_index import numpy as np class Row: """A class to represent one row of a Table object. A Row object is returned when a Table object is indexed with a...
06ad00fec8dcd0f8cfe753f63ff3657bf6074ec8911b60743ea075d8b3f2a0ca
# Licensed under a 3-clause BSD style license - see LICENSE.rst import platform import warnings import numpy as np from .index import get_index_by_names from astropy.utils.exceptions import AstropyUserWarning __all__ = ['TableGroups', 'ColumnGroups'] def table_group_by(table, keys): # index copies are unnece...
01500c44fbe1b840b5994b9590d7d938abcd8d814e5cddacd971e7b2d1a1f3db
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys import re import fnmatch import numpy as np from astropy import log from astropy.utils.console import Getch, color_print, terminal_size, conf from astropy.utils.data_info import dtype_info_name __all__ = [] def default_format_fun...
40c5ce95c5fb602e61894827ea7fc4bc730178129daa2acda4e156eb7e99bb33
# Licensed under a 3-clause BSD style license - see LICENSE.rst from os.path import abspath, dirname, join from .table import Table import astropy.io.registry as io_registry import astropy.config as _config from astropy import extern class Conf(_config.ConfigNamespace): """ Configuration parameters for `as...
682e3d8156b7564494d9716af5da937fdb12074a6c1a7a91053209788ed2b994
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.utils.data_info import ParentDtypeInfo class NdarrayMixinInfo(ParentDtypeInfo): _represent_as_dict_primary_data = 'data' def _represent_as_dict(self): """Represent Column as a dict that can be serialized...
a7dc76058f28227b71b261fbb2ed79e521f40d68fe418394cacafc67740247d8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import operator __all__ = ['BST'] class MaxValue: ''' Represents an infinite value for purposes of tuple comparison. ''' def __gt__(self, other): return True def __ge__(self, other): return True def __lt__(...
db6cde48d019a7516a096527dfad4880ddfce737eed00ed463371a967d1e3290
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from setuptools import Extension import numpy ROOT = os.path.relpath(os.path.dirname(__file__)) def get_extensions(): sources = ["_np_utils.pyx", "_column_mixins.pyx"] include_dirs = [numpy.get_include()] exts = [ Extens...
c42c0d5375112980d71b0cd6ee7070da392b7dabf5ff04f8a182d7475032a61b
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .index import SlicedIndex, TableIndices, TableLoc, TableILoc, TableLocIndices import sys from collections import OrderedDict, defaultdict from collections.abc import Mapping import warnings from copy import deepcopy import types import itertools impo...
0edf849fcdd5a25cd472ccc4709c3def8dce4f5d16be9e1c20e54ec0c3fd805a
import json import textwrap import copy from collections import OrderedDict import numpy as np import yaml __all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table'] class ColumnOrderList(list): """ List of tuples that sorts in a specific order that makes sense for astropy table c...
ab5e01a4fb8d8a279059c81db4a7b0a1576ef1e408f5507c38e6f8f05008a664
""" High-level table operations: - join() - setdiff() - hstack() - vstack() - dstack() """ # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import collections import itertools from collections import OrderedDict, Counter from collections.abc import Mapping, Sequence import nu...
96256403fa381e0dcf27947de86da85a4bd9ba0b09218f5e935f8f308e8c00bd
# Licensed under a 3-clause BSD style license - see LICENSE.rst from importlib import import_module import re from copy import deepcopy from collections import OrderedDict import numpy as np from astropy.utils.data_info import MixinInfo from .column import Column, MaskedColumn from .table import Table, QTable, has_in...
3803d4f018c9f128ab44a84800013570dd6f86430357447cbe49546064f5766e
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The SCEngine class uses the ``sortedcontainers`` package to implement an Index engine for Tables. """ from collections import OrderedDict from itertools import starmap from astropy.utils.compat.optional_deps import HAS_SORTEDCONTAINERS if HAS_SORTED...
063b408848582eabfe45f09a87c6613ed8319d53254aabea0b6810bce4266a4c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The Index class can use several implementations as its engine. Any implementation should implement the following: __init__(data, row_index) : initialize index based on key/row list pairs add(key, row) -> None : add (key, row) to existing data remove(...
2a7110f80c98f5adf82ba5a6956cf2039621dea290b84866126f7edc9f35c40e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np def _searchsorted(array, val, side='left'): ''' Call np.searchsorted or use a custom binary search if necessary. ''' if hasattr(array, 'searchsorted'): return array.searchsorted(val, side=side) # Python ...
74d945b8e25af2d5a74510c2585b7ad8c67bb880a8881cf09cb305eec7e60ff8
# -*- coding: utf-8 -*- ascii_coded = ('Ò♙♙♙♙♙♙♙♙♌♐♐♌♙♙♙♙♙♙♌♌♙♙Ò♙♙♙♙♙♙♙♘♐♐♐♈♙♙♙♙♙♌♐♐♐♔Ò♙♙♌♈♙♙♌♐♈♈♙♙♙♙♙♙♙♙♈♐♐♙Ò♙♐♙♙♙♐♐♙♙♙' '♙♙♙♙♙♙♙♙♙♙♙♙Ò♐♔♙♙♘♐♐♙♙♌♐♐♔♙♙♌♌♌♙♙♙♌Ò♐♐♙♙♘♐♐♌♙♈♐♈♙♙♙♈♐♐♙♙♘♔Ò♐♐♌♙♘♐♐♐♌♌♙♙♌♌♌♙♈♈♙♌♐' '♐Ò♘♐♐♐♌♐♐♐♐♐♐♌♙♈♙♌♐♐♐♐♐♔Ò♘♐♐♐♐♐♐♐♐♐♐♐♐♈♈♐♐♐♐♐♐♙Ò♙♘♐♐♐♐♈♐♐♐♐♐♐♙♙♐♐♐♐♐♙♙Ò♙♙♙♈♈♈♙♙♐' ...
f1ee16e162b20815876d2bc1e600a2b4c85cb8b2b7dc527b91caf1979ac11af1
""" High-level operations for numpy structured arrays. Some code and inspiration taken from numpy.lib.recfunctions.join_by(). Redistribution license restrictions apply. """ import collections from collections import OrderedDict, Counter from collections.abc import Sequence import numpy as np __all__ = ['TableMergeE...
d95774d69e7b29e829461969e1ddbf88bb2a3356ea8c13e0513bf44d7728212f
# 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 ....
05acf53b2bd558e8e021442eb12f9e2b4b4d268be0eb466a999e35bd805044ad
import warnings from textwrap import indent import astropy.units as u import numpy as np from astropy.constants import c from astropy.coordinates import (ICRS, CartesianDifferential, CartesianRepresentation, SkyCoord) from astropy.coordinates.spectral_q...
a6f98ac67a7295edbaaf85d6df817f784391b384cc1cc60710fba44f515f1205
import numpy as np from astropy.units import si from astropy.units import equivalencies as eq from astropy.units import Unit from astropy.units.quantity import SpecificTypeQuantity, Quantity from astropy.units.decorators import quantity_input __all__ = ['SpectralQuantity'] # We don't want to run doctests in the docst...