hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
7b0a3a665cc3ee12d7364156ef96e0b73861cf4a223216340339f75289971119 | # -*- 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... |
0cc34e8971d1642e4dbd9924c9600f90c35bd51ade0642e51895488a035964eb | # -*- 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... |
afadecf4e2361860ad68d51e55a4336d6aeb48b5afdfb54107e55c8fef2389af | # -*- 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
from concurrent.futures import ProcessPoolExec... |
2c8259647998dd5792b4229aae23702766d51fd4ea1a1e1927543efc121634dd | """
A simple class to manage a piece of global science state. See
:ref:`astropy: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
`v... |
cbd72c3d3599b4af14d1836d76de24bef14da9cf4f500aabfbffbb40b0e5a8db | # 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... |
cb60c2220883e25b341c065672b0d7669323952befc1edf48fa17e80b95bce24 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions related to Python runtime introspection."""
import collections
import inspect
import os
import sys
import types
import importlib
from importlib import metadata
from packaging.version import Version
from astropy.utils.... |
13690173895d42e221c1e4d9963b5819740001ac05c8db28a72ffb979714860e | import difflib
import functools
import sys
import numbers
import numpy as np
from .misc import indent
__all__ = ['fixed_width_indent', 'diff_values', 'report_diff_values',
'where_not_allclose']
# Smaller default shift-width for indent
fixed_width_indent = functools.partial(indent, width=2)
def diff_va... |
1ae8605ec5f30e90a820061913b1692c2594200378e6b09966bbe9d00c3083b5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains helper functions and classes for handling metadata.
"""
from functools import wraps
import warnings
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
import numpy as np
from astro... |
a216f86a94106d0ca2d60b02a58ff7db5c966dc9d6ac3b963104d85f022d87af | # 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... |
8fd62b3c6f47d0acfbda1416947ac9cccb266615ef77f9c5a066aea9a0ac42c2 | # 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.
"""
# TODO: deprecate these. This cannot be trivially do... |
c336ae5a955b4aa936c18c94cf3b790799c76490a67ee9a0789288d9ba777421 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from setuptools 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, 'src'... |
97d28a9c6e134bddf422075bad2ff2397365f547a8ae093eeb24b36b7d3cc1a4 | # -*- 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 ... |
f86c15d4faba6f58d123ee1f2ce1116be8eabc1270310cbc21fb260468733174 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Wrappers for PLY to provide thread safety.
"""
import contextlib
import functools
import re
import os
import threading
__all__ = ['lex', 'ThreadSafeParser', 'yacc']
_TAB_HEADER = """# -*- coding: utf-8 -*-
# Licensed under ... |
70f74ffb7676bef61af0a7f50a507ae1bbe4c21bf7494ebbb1d2c8802fe09add | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""The ShapedLikeNDArray mixin class and shape-related functions."""
import abc
from itertools import zip_longest
import numpy as np
__all__ = ['NDArrayShapeMethods', 'ShapedLikeNDArray',
'check_broadcast', 'IncompatibleShapeError', 'unbroadc... |
08b29f1710d11539a998d796b1142dee3516c30656093f3db008252c213e4395 | """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).
""... |
cac99fab383aec518aedbcfaef9260c3e8dfe395ca732bfb8c683320685bb31c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for accessing, downloading, and caching data files."""
import atexit
import contextlib
import errno
import fnmatch
import functools
import hashlib
import os
import io
import re
import shutil
import ssl
import sys
import urllib.request
import... |
c641013da3ddcf1a7e87b90200926d229f93e0aa36f6e16ba8cba8d096c93a43 | # -*- 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
import ... |
14473cc5932ce00bc8510847843aba766fcc9912ce59d803f0eabe6692b4a0e9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This packages contains python packages that are bundled with Astropy but are
external to Astropy, and hence are developed in a separate source tree. Note
that this package is distinct from the /cextern directory of the source code
distribution, as tha... |
f19ffe376c65f40c84a4b1767982490c6715617963e6106f75185d6c058e6bef | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... |
a8f4554c6b82ca918621b63ebbadb9a2602875e4ac41f6370082a93223ddeae3 | """
Normalization class for Matplotlib that can be used to produce
colorbars.
"""
import inspect
import numpy as np
from numpy import ma
from .interval import (PercentileInterval, AsymmetricPercentileInterval,
ManualInterval, MinMaxInterval, BaseInterval)
from .stretch import (LinearStretch, S... |
465f2a18a4058f716887448b29905301782d13165ec2887cf27855f49d2d9ec0 | # 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 .time import *
from .lupton_rgb import *
|
86a2da8bc88f3f94938aea572d183e8844b525d5ad3f5da237ccf3e12b898ff8 | # 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 : https://ui.adsabs.harvard.edu/abs/2004PASP..116..133L
"""
import nump... |
75280a34c72d7d0aecc49fad0cbb7f73a3b2bf26602008b8aeeabfc35f4aa42b | # 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 .transform import BaseTransform
__all__ = ['BaseInterval', 'ManualInterval', 'MinMaxInterval',
'Asymmetri... |
d27a258c47cc26ebda5f0899ad893d2655d4532445dbf90a2e33197da5c32e8e | # -*- 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... |
8ca125c0a81beae0f81623b0bf15a8297426bd9e9e0b407ada06fdd7b154b64d | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from datetime import datetime
from astropy.time import Time
from astropy import units as u
__all__ = ['time_support']
__doctest_requires__ = {'time_support': ['matplotlib']}
UNSUPPORTED_FORMATS = ('datetime'... |
041f9e8a9f9a2f169a6924de41239c68605c8025392f851daff4ec55ed3a2e93 | # 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.
__all__ = ['astropy_mpl_style_1', 'astropy_mpl_style']
# ... |
ffcbd5262c2d871bf6de6f7fa3b9601d510f25d706c5c794a0d0db9e00eac350 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.stats.histogram import calculate_bin_edges
__all__ = ['hist']
def hist(x, bins=10, ax=None, max_bins=1e5, **kwargs):
"""Enhanced histogram function
This is a histogram function that enables the use of more sophisticated
algori... |
71a8c989a3e3bb7f3c9326c21f7b5e93f14b6a8c52bebe465086e07a76482b4c | # 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... |
7d92dc92299b06452af6e261848cb0b900fe24550a613162a0883a72bdf1b4f9 | # 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 .transform import BaseTransform
from .transform import CompositeTransform
__all__ = ["BaseSt... |
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... |
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 ... |
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... |
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... |
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... |
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... |
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']
... |
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... |
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... |
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.
... |
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... |
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... |
b7ecbb7799ce3d630cbf431f00f8e35caef21e64cc5e9729eae5cf6a5dc4922f | """
This package contains utilities that are only used when developing astropy
in a copy of the source repository.
These files are not installed, and should not be assumed to exist at runtime.
"""
|
104a4df2e1cf56a864a81e2934dea1f845bf109388c66791809b4f23ce4cf27f | # Try to use setuptools_scm to get the current version; this is only used
# in development installations from the git repository.
import os.path as pth
try:
from setuptools_scm import get_version
version = get_version(root=pth.join('..', '..'), relative_to=__file__)
except Exception:
raise ImportError('set... |
393c376700f73581b7982cea2a3e16679726c209c9fce377551765bd8b29337b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from erfa import core, helpers, ufunc # noqa
from erfa.core import * # noqa
from erfa.helpers import leap_seconds # noqa
from erfa.ufunc import (dt_dmsf, dt_eraASTROM, dt_eraLDBODY, # noqa
dt_eraLEAPSECOND, dt_h... |
7469943f24848108d5908d6771e1e01d691619ec23f06ee36c8d76f4ef107038 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
.. _wcslib: https://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/index.html
.. _distortion paper: https://www.atnf.csiro.au/people/mcalabre/WCS/dcs_20040422.pdf
.. _SIP: https://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/shupeADASS.pdf
.. _F... |
c4a29d4947b97acd96582a8330344b80e0c2b14c8d44072f50a506f7f9b2c8dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Script support for validating the WCS keywords in a FITS file.
"""
def main(args=None):
from . import wcs
import argparse
parser = argparse.ArgumentParser(
description=("Check the WCS keywords in a FITS file for "
... |
2e65364cac93574374188290790db838cc076854d2135d7242951c2657f1c3b6 | # 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... |
e413db65a6606dd394400f73474007ba5d8690a17a4479c83882bf30f2ba0924 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import numpy as np
import astropy.units as u
from astropy.coordinates import CartesianRepresentation, SphericalRepresentation, ITRS
from astropy.utils import unbroadcast
from .wcs import WCS, WCSSUB_LATITUDE, WCSSUB_LONGITUDE
__doctest_ski... |
c07bbb5b8c24bc9546d1c45e5b700fa9d0777e9f68a9cc95c821bc712d9204ed | # 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... |
e58908fb2b8d5c410432ac4917b9dbd19e52ab1cb9e6ec66054a9b848c5aed40 | # 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 ... |
6c0b095f7774223e8e89fa1858bc059d897b7ae45f2aeedba9c9aa2fc17541cf | # -*- 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... |
77853a287648e0838ce7966e7d6d88042a35a911cee30a51c6b2d6ee9acd1a37 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import config as _config
class Conf(_config.ConfigNamespace): # noqa
"""
Configuration parameters for `astropy.table`.
"""
use_fast_parser = _config.ConfigItem(
['True', 'False', 'force'],
"Use fast C parser ... |
b0243777d8bb77d74ab43a0e909ecff367229f6d579374e316912559c75b2f7a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Copied from astropy/convolution/setup_package.py
import os
from setuptools import Extension
import numpy
C_TIME_PKGDIR = os.path.relpath(os.path.dirname(__file__))
SRC_FILES = [os.path.join(C_TIME_PKGDIR, filename)
for filename in ['src... |
d241d92bc130b1e33540d5212f80c7939d86a63d2bea0dea21490244be6e436e | # -*- 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... |
dcfaf8df506acbff729375740794ab3219086561f56a7648a933e606df526bd4 | # -*- 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... |
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,... |
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... |
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... |
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`).
"""
... |
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... |
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... |
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,... |
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... |
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... |
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... |
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... |
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... |
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... |
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... |
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()
##... |
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... |
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... |
0a0542b6ed699e22a02bb5cf9ef3d04a8611ec79e5a9d1c7d72cfe2f82ef433a | # 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 numpy as np
import erfa
from .sky_coordinate import SkyCoord
from astropy.utils.data import... |
1563e382ae85f07a5466953f66676305c11a4e5d7c68e2be33a9def8044217dc | # -*- 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.... |
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... |
da946455540b47f18c9e25117096f94418908d74e5efaa4c3d0a154d1f6f9569 | # -*- 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 astropy.utils.exceptions import AstropyWarning
__all__ = ['RangeError', 'BoundsError', 'IllegalHourError',
'IllegalMinuteError'... |
f0b4d4c9d86abb996205750f6cacc800593e500591c2f45950f5f1af66ab962a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utililies used for constructing and inspecting rotation matrices.
"""
from functools import reduce
import numpy as np
from astropy import units as u
from .angles import Angle
def matrix_product(*matrices):
"""Matrix mult... |
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 .... |
eb7e2b38d5f2be4d5cec4a1fb1a17898835f9cfa066008b1dc5ca8aa0ea4ff51 | # 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 astropy import units as u
from . import Angle
from .sky_coordinate import SkyCoord
__all__ = ['matc... |
ba37aca66382814cb3e1f00c1a7ff575ad0ddfd089c5e412c388ff2df7cee1b9 | import re
import copy
import warnings
import operator
import numpy as np
import erfa
from astropy.utils.compat.misc import override__dir__
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.utils.data_info import MixinInfo
from astropy.utils import ShapedLikeNDArray
from ast... |
87122ff8ea289169904b7fa7e8d1a541bbe090c30b749ad0c6e0fcd17ac68450 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file was automatically generated from ply. To re-generate this file,
# remove it from this folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
# pytest astropy/coordinates
#
# Y... |
2b5eee75bebd14fecf3b03acbbc955006eb47fd15e43f5db5763cb5b48b97f24 | # 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... |
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... |
a77360a077835fefcf25dffa2ba30c45ba20b3f29ae226cb737c6594ae701283 | """
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
import inspect
import warnings
import numpy as np
import astropy.units as u
from erfa import ufunc as erf... |
8a15aaa006139ea031ff99a39812a5a746157bac8d0b00bfe1af9a5e20ade85e | # 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... |
a533f5432c48980ecae823643527e936f4370210438df718f1e05c37ea8db5be | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains utility functions for working with angles. These are both
used internally in astropy.coordinates.angles, and of possible
"""
__all__ = ['angular_separation', 'position_angle', 'offset_by',
'golde... |
e11e18f1f02204695ebde82a5529f3956dd307c2f93e519f40cde45c2a427886 | # 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... |
607495916340d3bb1bd1704d9b5fe3120ff44ea944f613d8b22dd89722e90d5a | # 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 warnings
import numpy as np
from astropy import units as u
from astropy.utils.exceptions import AstropyWarning
from .angles import Angle
__al... |
89073340df9392d61d1fd3ce2b368366c8698408e96d627325eb96a9b184fc62 | # 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.
"""
import... |
e3fb251ae695c7b3b3aa4317fc1707793b17ae71a42935a43b03bae54a31387e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from collections.abc import Sequence
import inspect
import numpy as np
from astropy.units import Unit, IrreducibleUnit
from astropy import units as u
from .baseframe import (BaseCoordinateFrame, frame_transform_graph,
... |
a9c118cb514d27d7c1709080cabc29b065a98989a47632adc3e50474acccbd5d | # -*- 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 copy
import inspect
from collections import namedtuple, defaultdict
import warnings
# Dependencies
import numpy as... |
80f6aa6cc71f36ed9e842c1f19a3ccf7a37eb66d04d56c5bb09f22082a046465 | # 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
import e... |
ad01e01313b4c24268f58b0e41ca05736d23bdc45822188472a670a736e4b5ac | # 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... |
0261f2c91bdd5183afce8a928e81b335af6709c0dc260d287ef0a253c18f0897 | # -*- 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... |
0566c53a00c8936c9340584c62f6cff3a5adbf81512d8c765ea900aa5db37ca0 | """
Module for parsing astronomical object names to extract embedded coordinates
eg: '2MASS J06495091-0737408'
"""
import re
import numpy as np
import astropy.units as u
from astropy.coordinates import SkyCoord
RA_REGEX = r'()([0-2]\d)([0-5]\d)([0-5]\d)\.?(\d{0,3})'
DEC_REGEX = r'([+-])(\d{1,2})([0-5]\d)([0-5]\d)\.... |
3f1fb418901952bd452957471370989c78d388d0373ee20db65a1ab37bb0c2e0 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Dependencies
import numpy as np
# Project
from astropy import units as u
from astropy.utils import ShapedLikeNDArray
__all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute',
'EarthLocationAttribute', 'Coordinate... |
98d2632db173ddf7793886794b8f7b207e990e21a5cc5fe4bc935a6722792794 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains a helper function to fill erfa.astrom struct and a
ScienceState, which allows to speed up coordinate transformations at the
expense of accuracy.
"""
import warnings
import numpy as np
import erfa
from astropy.time import Time
fro... |
8faff0723956dcccb1bda9085b3e5f2a81cb54e528e3498afb3b05539931aa10 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Standard library
import re
import textwrap
import warnings
from datetime import datetime
from urllib.request import urlopen, Request
# Third-party
from astropy import time as atime
from astropy.utils.console import color_print,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.