hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
ca29e29b37ea504c37af46836d1580b4628deb3cc6d6910d12d2bd090e1b7057 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy import exp
import astropy.units as u
from astropy.cosmology.parameter import Parameter
from astropy.cosmology.utils import aszarr
from . import scalar_inv_efuncs
from .base import FLRW
__all__ = ["w0wzCDM"]
__doctest_requires__ = {'*': ['sc... |
b5927a4ad722a65127784ccd958d6e3c50b627c5ba13a9d2261ec6ecdb6421c6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from abc import abstractmethod
from math import exp, floor, log, pi, sqrt
from numbers import Number
import numpy as np
from numpy import inf, sin
import astropy.constants as const
import astropy.units as u
from astropy.cosmology.core im... |
a434ad034a2da4ce617c9ea595aed7b59b9e70d4d80412c0f8c432ec5abe42db | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy import sqrt
import astropy.units as u
from astropy.cosmology.parameter import Parameter
from astropy.cosmology.utils import aszarr
from . import scalar_inv_efuncs
from .base import FLRW, FlatFLRWMixin
__all__ = ["wCDM", "F... |
de59010cff353c6199c11a92e171de58a8f568a97cb1564d2881af82c6854780 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from math import acos, cos, inf, sin, sqrt
from numbers import Number
import numpy as np
from numpy import log
import astropy.units as u
from astropy.cosmology.utils import aszarr
from astropy.utils.compat.optional_deps import HAS_SCIPY
from . import s... |
748b818876a73277a3b8de190906ffe5e6198d21b9ade188ca16535366d392cd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy import exp
import astropy.units as u
from astropy.cosmology import units as cu
from astropy.cosmology.parameter import Parameter
from astropy.cosmology.utils import aszarr
from . import scalar_inv_efuncs
from .base import FLRW
__all__ = ["wp... |
ddfcbc66c577551cf511121e6bd8ffcc9e25f30c0e84fd5788d9afbdb35ae843 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy import exp
import astropy.units as u
from astropy.cosmology.parameter import Parameter
from astropy.cosmology.utils import aszarr
from . import scalar_inv_efuncs
from .base import FLRW, FlatFLRWMixin
__all__ = ["w0waCDM", "Flatw0waCDM"]
__d... |
ecccf9a74444f9e5ab55c25f9138f3fd26a84ad764b3f9fab97b7c3907565066 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import inspect
import random
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology.core import Cosmology
from astropy.cosmology.io.model import _CosmologyModel, from_model, to_model
from astropy.cosmology.tests.helper im... |
0255fe457bf1b3f16eea1de86cd524a9922c343a523f26fa1d30e968856e0ddd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import inspect
from collections import OrderedDict
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology import Cosmology
from astropy.cosmology.io.mapping import from_mapping, to_mapping
from .base import ToFromDirectT... |
c562c51b711dc907f94d680f344079818c61ae63c60eb01eb6f941e9b0922596 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# THIRD PARTY
import pytest
# LOCAL
from astropy.cosmology import Cosmology
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.cosmology.io.table import from_table, to_table
from astropy.table import QTable, Table, vstack
from .base impo... |
fdb18202dbedabf565214a6d0d15edcbf15cfcfbec39afae38a81f7ca0a46d7c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import Cosmology, FlatLambdaCDM, Planck18
from astropy.cosmology import units as cu
from astropy.cosmology.io.yaml import from_yaml, to_yaml, yaml_constructor,... |
d244ceac0cc3f6bb986d145fe8d13ca13da850edff014f7198657030e715cdcc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# THIRD PARTY
import pytest
# LOCAL
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.cosmology.io.ecsv import read_ecsv, write_ecsv
from astropy.table import QTable, Table, vstack
from .base import ReadWriteDirectTestBase, ReadWriteTes... |
c269c8e008d640a6daf1bdb7f10049be8ab4bf114d9f5321c26cad50bc593841 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import json
import os
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import units as cu
from astropy.cosmology.connect import readwrite_registry
from astropy.cosmology.core import Cosmology
from .base impo... |
c39669490997993040cb4a77c3f3913897b25a83d1da1ad8aad2152250579086 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# THIRD PARTY
import pytest
# LOCAL
from astropy.cosmology.io.cosmology import from_cosmology, to_cosmology
from .base import IODirectTestBase, ToFromTestMixinBase
###############################################################################
class ... |
edc03b391c581fe7b7557cf5d45be14467338336a3d6ede0c24cf744f70cc9a6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.wpwazpcdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.cosmology.units as cu
import astropy.units as u... |
dbc680aa0a2396a3cf1ac616f1b09fd59fe4e0a59c589098fa56032c33da0bb4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.lambdacdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import FlatLa... |
c46caee2fb7c7380c452f9f632878b1364cb8e212114f5fb5dade2e4d5612010 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.base`."""
##############################################################################
# IMPORTS
# STDLIB
import abc
import copy
# THIRD PARTY
import numpy as np
import pytest
import astropy.constants as const... |
fedb7cc8f78de6c576d024048015860c13e3dca78237835a2a92b6b6dc846159 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.w0wzcdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import w0wzCDM
... |
794539e40e64142488a7af7e532cf524114c7d8ba082daa3ea06e5974abeac55 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.w0wacdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import Flatw0wa... |
de0f148f1d3f48c5b7770cb07b8915f5b206c628f83fd681f2650fdd5e8611ed | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.w0cdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import FlatwCDM, ... |
dfaf2c4855f9658a13b8c4311b3e7f7bffa92c19876148b2a9ddf1b9a4103586 | # -*- 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... |
6dd7b6545ee9469ed5d9fcdc50a80bee50704552f094c64092fb8a2667ce09dc | import os
import shutil
import sys
import erfa # noqa
import matplotlib
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 scr... |
3b355f16cc7f8b082f727699cd9bdbddd349e6924f11d0d03d69bec01817b4ca | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple statistical algorithms that are
straightforwardly implemented as a single python function (or family of
functions).
This module should generally not be used directly. Everything in
`__all__` is imported into `astropy.stats... |
e996d496421daf77dfc62a9387601961e930877f78dfcd8acdf6622239f8ec6e | # 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... |
174e33f88b6aba2e6909ca16e2cf60fa24d4d06d6856754547c9a08dfb9d6efd | # 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... |
bf74019a96521e5383d769dd9ba473541dabed8d565a9be7feac87042514dac1 | # 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, StructuredUnit
from astropy.utils.console import color_print
from astropy.utils.metadata import ... |
e779e71fe5beef1a0a85afe182775be7a7afd958dd55af8b91ebbf90659165c6 | # 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... |
744774ebec167e70974691347ab71214d1c79fee42ff233598b3b73d7893ae16 | """
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... |
abd1acdb8da41d1e308e8d480fbc0144bb9bd1a25742da2162b9c429109b4b9f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from importlib import import_module
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_info_class
f... |
74dad99dc6fe96e523916922846c63473d3a15dd9813a0559c881d6ee76da85e | # 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... |
2a69a60db69a5ebb3fab54064dd8ddd703791200809ee07862f1327ed036b28f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements classes (called Fitters) which combine optimization
algorithms (typically from `scipy.optimize`) with statistic functions to perform
fitting. Fitters are implemented as callable classes. In addition to the data
to fit, the ``__c... |
b9155d95d993304e8d4f440e565a3a8bfe1bd3b84b82286d3320d7b8d32949fb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
"""
This module defines classes that deal with parameters.
It is unlikely users will need to work with these classes directly,
unless they define their own models.
"""
import functools
import numbers
import operator
impo... |
fade95c48e8dd081ff4b3421a1c1605ff5e58e3daf8ebb826a8e2bc43bfc564c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines base classes for all models. The base class of all
models is `~astropy.modeling.Model`. `~astropy.modeling.FittableModel` is
the base class for all fittable models. Fittable models can be linear or
nonlinear in a regression analys... |
9c6aaf3b3680155b9a33108b3b4481369a3191d41b39ea841669af5ac8d46b23 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Convolution Model"""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import numpy as np
from .core import CompoundModel
class Convolution(CompoundModel):
"""
Wrapper class for a convolution model.
Param... |
db775a3dfa622918ef6cdd6937f0ccff195faa8589f2709d6a16cd307d07cabb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage provides a framework for representing models and
performing model evaluation and fitting. It supports 1D and 2D models
and fitting with parameter constraints. It has some predefined models
and fitting routines.
"""
from . import fitti... |
23a795000b38f635cab2565c00ded2e010cc398e489a80f9069e59a2e6d8448e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Creates a common namespace for all pre-defined models.
"""
# pylint: disable=unused-wildcard-import, unused-import, wildcard-import
from . import math_functions as math # noqa: F401, F403
from .core import custom_model, fix_inputs, hide_inverse # ... |
de6d7ccb0cff2c444c79c8ebc371bd77c8152bfad370bd09b5f9e203e1fcbfdf | """
Special models useful for complex compound models where control is needed over
which outputs from a source model are mapped to which inputs of a target model.
"""
# pylint: disable=invalid-name
from astropy.units import Quantity
from .core import FittableModel, Model
__all__ = ['Mapping', 'Identity', 'UnitsMappi... |
41e4e64943c25af75961a6791069546f1040a6b4c03ce25de70ef30e428b2874 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Implements rotations, including spherical rotations as defined in WCS Paper II
[1]_
`RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in
WCS Paper II to rotate to/from a native sphere and the celestial sphere.
The implement... |
131cb50c86a6b04a36a57600d759fde99b3b0b50d5619ef7ac8d99548c3bcce6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define Numpy Ufuncs as Models.
"""
import numpy as np
from astropy.modeling.core import Model
trig_ufuncs = ["sin", "cos", "tan", "arcsin", "arccos", "arctan", "arctan2",
"hypot", "sinh", "cosh", "tanh", "arcsinh", "arccosh",
... |
9f127a86991fe59aab3eed36464d8c7a993227e5a881e05d8fb732d93ddb976d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions to determine if a model is separable, i.e.
if the model outputs are independent.
It analyzes ``n_inputs``, ``n_outputs`` and the operators
in a compound model by stepping through the transforms
and creating a ``coord_matrix`` of shape (``n_... |
fbe3ac45b28b7600c4a032383ef2eb5b172d7a0547e22775e71d15eefc413f4f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides utility functions for the models package.
"""
import warnings
# pylint: disable=invalid-name
from collections import UserDict
from collections.abc import MutableMapping
from inspect import signature
import numpy as np
from astro... |
ecdce5bca110cd073d804e34c412f90fc85b05788c4260d425e4fd4d4d09ba9c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module is to contain an improved bounding box
"""
import abc
import copy
import warnings
from collections import namedtuple
from typing import Any, Callable, Dict, List, Tuple
import numpy as np
from astropy.units import Quantity
from astropy... |
cd807957aeef12508041a99af4143ed386f3ed8ff0010315069a09e0b51e1e5a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Mathematical models."""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import numpy as np
from astropy import units as u
from astropy.units import Quantity, UnitsError
from .core import Fittable1DModel, Fittable2DMo... |
fd2d04b2c3dff04640ef09a87c182f606c1e08c2edc2c8b297c23b3d1866a50e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""
Implements projections--particularly sky projections defined in WCS Paper II
[1]_.
All angles are set and and displayed in degrees but internally computations are
performed in radians. All functio... |
aee55ba2c07686583d13dbc5acee763315ab7ca8c84b3288c17a80765bb3d7fb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains models representing polynomials and polynomial series.
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.utils import check_broadcast, indent
from .core import FittableModel, Model
from .functional_models import... |
45bcf3fc2163a406073de8c43fa0ef7897828832d0ef27c431f3eb8f612bd084 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tabular models.
Tabular models of any dimension can be created using `tabular_model`.
For convenience `Tabular1D` and `Tabular2D` are provided.
Examples
--------
>>> table = np.array([[ 3., 0., 0.],
... [ 0., 2., 0.],
... ... |
08e7f1afa3a78bc139d4b58143a1277cbf1f6893850226cc17254c68d4d93f3f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Models that have physical origins.
"""
# pylint: disable=invalid-name, no-member
import warnings
import numpy as np
from astropy import constants as const
from astropy import units as u
from astropy.utils.exceptions import AstropyUserWarning
from .... |
4d90cbfab07e7be952216a576d61c3e7451092efa9dd0a037d943841805a6cec | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Statistic functions used in `~astropy.modeling.fitting`.
"""
# pylint: disable=invalid-name
import numpy as np
__all__ = ["leastsquare", "leastsquare_1d", "leastsquare_2d", "leastsquare_3d"]
def leastsquare(measured_vals, updated_model, weights, *x... |
e1a9c2ed67128e7b5924dfb388c34094eeff3e0e8e995e7b32270f418b7a1a42 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.units import Quantity
from .core import Fittable1DModel
from .parameters import InputParameterError, Parameter
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D', '... |
c2b31b48a91d7fa3d436ebd0ee91390fa888d52372811d2400b7e41722cef8e8 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Sundry function and class decorators."""
import functools
import inspect
import textwrap
import threading
import types
import warnings
from inspect import signature
from .exceptions import (AstropyDeprecationWarning, AstropyUs... |
1c8958ce5877ada632b7df08ad23525460cc81a037e375741714f639cffebad9 | # -*- 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 ... |
32743e0748e5d6298d4da77ae301fdbdd39407397a868cef92eb531ac3b6de33 | # 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... |
8e3f3e0b6ab37c264a94a88c6639c85142286f5dfca2e0ad7a0daec8ffd05c6e | # 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... |
8c0ae7b79a582d50f842d974756fd2f2084afd05425cced785a6327e3576939e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
from os.path import join
import os.path
import shutil
import sys
from collections import defaultdict
from setuptools import Extension
from setuptools.dep_util import newer_group
import numpy
from extension_helpers import import_file... |
d8732fd88d7dedc838c2683218ac5f94373f3912cd3a5794481acf5177df4eb4 | # 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 disto... |
871a5566c23da0af1aa0d0eb4f874b047012db791ce3988e3c33b865d680f82a | # 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 ... |
c3774b87970dc1c5e6082dee868393c482d84a8c530597b3b1c24d53a27161a0 | # -*- 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... |
fae2457c8c0689cf59cec034633f409e51ed5514eb064542507a44710c7a83b6 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import fnmatch
import time
import re
import datetime
import warnings
from decimal import Decimal
from collections import OrderedDict, defaultdict
import numpy as np
import erfa
from astropy.utils.decorators import lazyproperty, cl... |
b4d42de75c50996d8e073acb51a94f6ab9891605d765f4ed2183669d48bc13d6 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ['quantity_input']
import inspect
from collections.abc import Sequence
from functools import wraps
from numbers import Number
import numpy as np
from . import _typing as T
from .core import Unit, UnitBase, UnitsError, ... |
d8204c9f99851ddb1937a8bf4471699de635bcb4aef97acfa866db527f79d210 | # -*- 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... |
97e81d2aa35008ac62c52227c5c2a3a45d62b94639fc45986c7057a88da438d7 | # -*- 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... |
1e48d9a5558c54ab8f7ea354af7a485175e13d75b9d3d67010e2cf3db6708e0e | # -*- 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`).
"""
... |
57eabc16767ed2bf85d754479e4f84c69f07ac446bd3e4e7701bb06cc208934c | # 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... |
7949c579fc748fefe6871319c20c5c8d0f22468b2bc0fc5e40fa330504191b75 | # -*- 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... |
3da697df1a97f319f5df375bb55a1c93c087d055030f73e2f98b5ca2d01c9a20 | # 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... |
cca7b78dbd4d33677eb70140a56c5f0df9476791a4ffbea4b74ed6d4f82f2de5 | # -*- 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 astropy.constants import si as _si
from . import si
from .core import UnitBase, binary_prefixes, def_u... |
b05ccc83531b67b13fbd15757de7875735a5c562111837ce80ee5a7f5bf4f157 | # 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 astropy.utils.exceptions import AstropyDeprecationWarning
from . import imperial # noqa # Needed for backward namespace compat, see #11975 and #1... |
53028260bf0167ebc9ce977da1a8a7c5acf9c79b36741a041db177964d49756a | # 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)... |
4c06a84d0a5c2bfa48147f7a4d03ebe8bc3feb2ba3132029b54959224e9c7324 | # -*- 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(['cm... |
912b183eb9538b325a17434bbeee274836969c13d995a4d3b114a974cd791272 | # -*- 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... |
afcd413718c5fec5423cb4dfb15cb8ed2f180863df94df42d55defff7c5bea80 | # -*- 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 UNITY, Unit, UnitBase
__all__ = ['StructuredUnit']
DTYPE_OBJECT = np.dtype('O')
def _names_... |
d487d964aa6b727aa64d0601d052b64bf1c831acb33887088802530fd17a7c45 | # -*- 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.
"""
# STDLIB
import n... |
378d9506fedad1757b20370e28b4610308f4832689ce1c6c156e77e5caa151f5 | # -*- 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.
"""
import numpy as _numpy
from astropy.constants import si as _si
from .core import Unit, UnitBase, def_unit
_ns = globals()
#... |
0db56b1c9540edfbf0e9a3c0a52137e910d46f0516486cbe98beca3ee6484a0a | # -*- 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 astropy.constants import si as _si
from . import si
from .core import UnitBase, binary_prefixes, def_unit, set_enab... |
55fb26aa45d0335a118c2b93b3e382d1b5271d0fec75e9da8545b860063918ac | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""A set of standard astronomical equivalencies."""
import warnings
from collections import UserList
# THIRD-PARTY
import numpy as np
# LOCAL
from astropy.constants import si as _si
from astropy.utils.exceptions import AstropyDeprecationWarning
from ast... |
f7d7c0a22b63048da2d1a0ecc6c971d850c8c02b208140da375304ef9a55d8f5 | # 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
import os.path
import re
import numpy as np
import erfa
from .sky_coordinate import SkyCoord
from astropy.utils.d... |
6fd2a118611249e1f3d9c9d217254ffd4452f04066638a2a6b700ef11673b1ee | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.... |
f598649abc6333a4346e816113fcdc14a06c7fade567b92d9582718e1a3e7c3c | # 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... |
e36719d1c40db795efeb84b4f116bd3a658552468dca530f3f2fcb415f6ce03c | # 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
import erfa
from astropy import units as u
from astropy import constants as consts
from astropy.units... |
87e9c692c397784bf8b84a051a7760afe444e34d631e226f23e83b573dd83c15 | # -*- 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 warnings
from collections import namedtuple
import numpy as np
from . import angle_formats as form
from astropy import uni... |
d001322ad0b897bc4382eb3f4defe78bd27e7189324ed63e30eb385346cc4f6a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from types import FunctionType
from contextlib import contextmanager
from functools import wraps
from astropy.table import QTable
__all__ = ['BaseTimeSeries', 'autocheck_required_columns']
COLUMN_RELATED_METHODS = ['add_column',
... |
4524af84164587a5d7cf5f73ac6a3110df2df67358267d9d79650e922da881a4 | # 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... |
62bd69ffe08766df04f9477574cfb3a624469b2c9b6e56d3685ee74abc026b10 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.cosmology import units as cu
from astropy.io import registry as io_registry
from astropy.units import add_enabled_units
__all__ = ["CosmologyRead", "CosmologyWrite",
"CosmologyFromFormat", "CosmologyToFormat"]
__doctest_skip__ = _... |
467139c92184b906932eb58928d47a3b09ecca5798e6e1a8f7ac6af1beb6f327 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import annotations
import abc
import inspect
from typing import Mapping, Optional, Set, Type, TypeVar
import numpy as np
from astropy.io.registry import UnifiedReadWriteMethod
from astropy.utils.decorators import classproperty
from astr... |
3f29c376d6aee15921ab5b884ff0423e42ea11facdd4a206a993e6dbb719283b | # 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... |
fe056b4e8cd30de6e93deb75d3230d34f98e94027bea2dcf92a50a7a332e0195 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import astropy.units as u
from astropy.utils.decorators import deprecated_attribute, deprecated_renamed_argument
__all__ = ["Parameter"]
class Parameter:
r"""Cosmological parameter (descriptor).
Should only be used with a :class:`... |
42007e0caf9620a5c763fe308563fb85342e0fc43c089803cbd67dcd4f2328b1 | # 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__ = [... |
525867e54438833265d9139bcdf0b8f116e98c4c3dd5b961a0edd36d706f174b | # 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... |
a7c49aeae2599dec37dec63934bfa472a6b60f992f237907c917bd4609dd3a4e | # -*- 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",
... |
62e7e54582e9bd41c7370e85a187f928f3d3812795a649830af72a8c7d51e2bc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import pathlib
import sys
from typing import Optional, Union
# 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
_COS... |
4291be6e62d5ffa89c28e4a7827347efc340e29b9ec1de2b1678b9772c652de7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``showtable`` is a command-line script based on ``astropy.io`` and
``astropy.table`` for printing ASCII, FITS, HDF5 or VOTable files(s) to the
standard output.
Example usage of ``showtable``:
1. FITS::
$ showtable astropy/io/fits/tests/data/tabl... |
dba10680844500c7bfcb252f9df7a0e2009d283f49c59959d2ca736fe8be8ea6 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.utils.tests.test_metadata import MetaBaseTest
import gc
import os
import sys
import copy
from io import StringIO
from collections import OrderedDict
import pathlib
import pickle
import pytest
import numpy as np
from n... |
c7e35732a8a171873b0aad59a7d80518bc66a0a20469c1e37e326700ec5f321b | import os
import re
import pytest
from astropy.table.scripts import showtable
ROOT = os.path.abspath(os.path.dirname(__file__))
ASCII_ROOT = os.path.join(ROOT, '..', '..', 'io', 'ascii', 'tests')
FITS_ROOT = os.path.join(ROOT, '..', '..', 'io', 'fits', 'tests')
VOTABLE_ROOT = os.path.join(ROOT, '..', '..', 'io', 'vot... |
cb694989fadad22d2b0a06c068efaf989df28ebb6d14f9987bfa17ff5c03274e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.table import Table, Column, QTable, table_helpers, NdarrayMixin, unique
from astropy.utils.compat import NUMPY_LT_1_22, NUMPY_LT_1_22_1
from astropy.utils.exceptions import AstropyUserWarning
from astropy imp... |
459581c14fa9545a0d308eca95131927fd126fd9e6c6c40e277f6eb6ba2103f6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
All of the pytest fixtures used by astropy.table are defined here.
`conftest.py` is a "special" module name for pytest that is always
imported, but is not looked in for tests, and it is the recommended
place to put fixtures that are shared between mod... |
62db3e1d6e21f8fb15b25b032edb54d45f685d05b18a41d0f2430c731637aedd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.table.table_helpers import ArrayWrapper
from astropy.coordinates.earth import EarthLocation
from astropy.units.quantity import Quantity
from collections import OrderedDict
from contextlib import nullcontext
import pytest
import numpy as np
... |
61e96cc44170c25e657b0c64b628712ba0a8784859abbfd5c175345d4b1a6776 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import pickle
from io import StringIO
import pytest
import numpy as np
from astropy.table.serialize import represent_mixins_as_columns
from astropy.utils.data_info import ParentDtypeInfo
from astropy.table.table_help... |
e9bda0d4e9d7bb30eabd5f803d0965b2c083748ad298b9246c57439adf01c4ac | # This Python file uses the following encoding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from io import StringIO
from astropy import table
from astropy.io import ascii
from astropy.table import Table, QTable
from astropy.table.table_helpers import simple_... |
e45171903853bfafc2f25724d639e1f4c2da981a9dc8c973f1a2123125a051d1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.convolution.utils import discretize_model
from astropy.modeling.functional_models import (Box1D, Box2D, Gaussian1D, Gaussian2D,
... |
85d963d76cac465509dce7b4bf7c4068c88db056ad49ac3ff9573ce80e433b72 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to test statistic functions
"""
import numpy as np
# pylint: disable=invalid-name
import pytest
from numpy.testing import assert_almost_equal
from astropy.modeling.models import Identity, Mapping
from astropy.modeling.statistic import leastsqua... |
304716f3bfc9d483d329c48f53bb0f81e23691a827f2704cb2456577d1bacece | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test sky projections defined in WCS Paper II"""
# pylint: disable=invalid-name, no-member
import os
import unittest.mock as mk
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_almost_equal
from astropy import units a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.