hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
6fb384bbcfbca76195fa79b9931025e90afaa614de7ebcca9e22aaaa7d0c25f3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .client import SAMPClient
from .hub_proxy import SAMPHubProxy
__all__ = ["SAMPIntegratedClient"]
__doctest_skip__ = ["SAMPIntegratedClient.*"]
class SAMPIntegratedClient:
"""
A Simple SAMP client.
This class is meant to simplify the... |
61378ed2c9cfe58a26ab0d8d0dac2b92b16138461b5fdd04d354ab7826036fbd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage provides classes to communicate with other applications via the
`Simple Application Messaging Protocol (SAMP)
<http://www.ivoa.net/documents/SAMP/>`_.
Before integration into Astropy it was known as
`SAMPy <https://pypi.org/project/sam... |
38fbfd2ea381017a1d6f46800c93aaac0350ba8542aa38e27ce89104e132333d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import socketserver
import sys
import traceback
import warnings
import xmlrpc.client as xmlrpc
from xmlrpc.server import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
from .constants import SAMP_ICON
from .errors import SAMPWarning
__all__ = []
clas... |
25f68de1005fe6c70ca5c2f8f4aa912af71de600e2ce588e2a17d5bf7a2fa6cf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import os
import select
import socket
import threading
import warnings
from urllib.parse import urlunparse
from .constants import SAMP_STATUS_OK, SAMP_STATUS_WARNING
from .errors import SAMPClientError, SAMPWarning
from .hub import SAMPHubSe... |
b88be941c73d3fc0053dd3a1ee0ef6b2781a510add02fd7cfe8774fae22dd40f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utility functions and classes
"""
import inspect
import queue
import traceback
import xmlrpc.client as xmlrpc
from io import StringIO
from urllib.request import urlopen
from .constants import SAMP_STATUS_ERROR
from .errors import SAMPProxyError
de... |
a789441a36697d93ebc5e47701dfb1793596936a1654ba18d795343251e5e494 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines constants used in `astropy.samp`.
"""
from astropy.utils.data import get_pkg_data_filename
__all__ = [
"SAMP_STATUS_OK",
"SAMP_STATUS_WARNING",
"SAMP_STATUS_ERROR",
"SAFE_MTYPES",
"SAMP_ICON",
]
__profile_version__ = "1.... |
c2f80940a1ab628b28bef04bb0f2a251569a989bb90ca3b23a5f2d697db7309b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import xmlrpc.client as xmlrpc
from .errors import SAMPHubError
from .lockfile_helpers import get_main_running_hub
from .utils import ServerProxyPool
__all__ = ["SAMPHubProxy"]
class SAMPHubProxy:
"""
Proxy class to simplify the c... |
0f4dda8c933670a49445f9603b5e26f2c27aa0bb11af2cb17dcc0652fb8d8877 | # 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,
AstropyPendingDeprecatio... |
125146c0db77676adb8383b5e914687e2788bf92da4691a673879ea1f03ca976 | # 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_signature"]
_ARGNAME_RE = re.c... |
78541ec954e122e8516e27da3b2ec93454d07a4b02daab9da3c05a78c49a0977 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for console input and output.
"""
import codecs
import locale
import math
import multiprocessing
import os
import re
import struct
import sys
import threading
import time
# concurrent.futures imports moved inside functions using them to avo... |
16c96cc7406bbbda9c279c34b73356d8fccea29d397df48172bc63119ff16782 | """
A simple class to manage a piece of global science state. See
:ref:`astropy:config-developer` for more details.
"""
__all__ = ["ScienceState"]
class _ScienceStateContext:
def __init__(self, parent, value):
self._value = value
self._parent = parent
def __enter__(self):
pass
... |
d25461832cc35c402c1411b19ee6f324689bd1ed963813f25f60a53096e5ab00 | # 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... |
03dab4efd68abe3b44509bc40460886bfb6bb1eabbab5a6b025b9b46fda6d5c8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions related to Python runtime introspection."""
import collections
import importlib
import inspect
import os
import sys
import types
from importlib import metadata
from packaging.version import Version
from astropy.utils.decorators import depre... |
b22ec281326d59b9102ac53e03958d6748865165282ac3bb986214a0363cbfaa | import difflib
import functools
import numbers
import sys
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... |
98f4876fdbd0ca26cda9f7a7a79b947160928f062cc95eabe970787560c54831 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains helper functions and classes for handling metadata.
"""
import warnings
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
from functools import wraps
import numpy as np
from astrop... |
d72591fa060c543712bee48967ed93d71adc91b8d6699c190e3436ace6f4fd31 | # 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... |
06d481198ba9f81d83bbf879afba8279167355b86913302a6850389204b066af | # 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... |
b70d2ce2b773c7b80cf7b440db754beab5a10ce6623abaa0b23f4ae175c5d5c1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from os.path import dirname, join, relpath
from setuptools import Extension
ASTROPY_UTILS_ROOT = dirname(__file__)
def get_extensions():
return [
Extension(
"astropy.utils._compiler",
[relpath(join(ASTROPY_UTILS_ROO... |
6ed9988ea7adbb77da55a4c29c8d1cb1a4f3e8c6f9871a9209ff090d4d96c165 | # 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 Time classes in
astropy.... |
d89dd0d2547fe02136cbe813d7f764a70387c8cc9cc3a1441bfcd0d35f96cb6d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Wrappers for PLY to provide thread safety.
"""
import contextlib
import functools
import os
import re
import threading
__all__ = ["lex", "ThreadSafeParser", "yacc"]
_TAB_HEADER = """# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style lice... |
a267897a170c3192e2f18f8ce480d9b78e051bd7819ed04310559fc5d1b07dab | # 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",
... |
2dc698aa653113db4f4d856438f7dfb6227c3e20205c10480bf555893a50a92a | """Utilities and extensions for use with `argparse`."""
import argparse
import os
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).
"""... |
e4135b3bd1807fe5f236164cce8b521b2f3ffbf499d1fa7467283c0962c51c3d | # 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 ftplib
import functools
import hashlib
import io
import os
import re
import shutil
# import ssl moved inside functions... |
06226b1d00dd89965db01d26b8ff18cb89ea29a2b569cee23778233085986265 | # 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 locale
import os
import re
import signal
import sys
import ... |
a939933f2a8c2e95093207c0094090abbb920c94c4c04c2e8e80a9a7e3b30f53 | """
Normalization class for Matplotlib that can be used to produce
colorbars.
"""
import inspect
import numpy as np
from numpy import ma
from .interval import (
AsymmetricPercentileInterval,
BaseInterval,
ManualInterval,
MinMaxInterval,
PercentileInterval,
)
from .stretch import (
AsinhStretc... |
72cefd0dfaa407d5c3bd9d6181c54ac8144c0481ce4037fbd5e7a5285a16bf8b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .hist import *
from .interval import *
from .lupton_rgb import *
from .mpl_normalize import *
from .mpl_style import *
from .stretch import *
from .time import *
from .transform import *
from .units import *
|
c76280814cb0e8e9babd4892bce54b1989d0454cdf9229ff7aef116ea08e5c36 | # 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... |
e4d39c64d97724c10ab9f230de18b4a5024c61fbba43027501c0859c86748317 | # 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 astropy.utils.decorators import deprecated_attribute, deprecated_renamed_argument
from .transform import BaseTransfo... |
6e637ce8f8ec6fce33c4f257133fb419493b245c754f93b589585dc6cfa50765 | # 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 with a ``with`` statemen... |
4035c86ad8883c1b44e5c2f71f8fc5d24f79948d2da4f7a6962067564be6a709 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from datetime import datetime
import numpy as np
from astropy import units as u
from astropy.time import Time
__all__ = ["time_support"]
__doctest_requires__ = {"time_support": ["matplotlib"]}
UNSUPPORTED_FORMATS = ("datetime", "datetime64")
YMDHMS_F... |
23299cd01630ae6daa4c8bf15e308e413dea7ab6cd902bd8ae84b20205654133 | # 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"]
# ... |
9e5967ebca5af2947c4b6f7f45e1c191d2b0da4ced1c5b268ea3bf403a3afeff | # 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... |
77156684d78d0cb0cb9c879e3fbd0f03c0ce130982d75af320b08b468d00b5d0 | # 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... |
9e0fe7b06d9658384c35a4a86f1c9e16c6cacf359b12493fa2462280907b4d02 | # 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, CompositeTransform
__all__ = [
"BaseStretch",
"Linea... |
1cdb2320ed344faf20b4daf782dd8f215932a776167fd0011d3ec86dcbb76cad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from copy import deepcopy
from functools import wraps
from inspect import signature
from itertools import islice
from astropy.utils.exceptions import AstropyUserWarning
from .nddata import NDData
__all__ = ["support_nddata"]
# All su... |
e3ddaa461c7b032e892b45bd6b98a68aa0407de8a82dba4322ba12d3db11e060 | # 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 m... |
4dfada30ed21bd96ec4af9806b3aad6b216dbb00232bcb7b88c7b38dc183b763 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import weakref
from abc import ABCMeta, abstractmethod
from copy import deepcopy
import numpy as np
# from astropy.utils.compat import ignored
from astropy import log
from astropy.units import Quantity, Unit, UnitConversionError
__all__ = [
"Missin... |
5fcb43e7460fc7e85e03e3f9e165fce70fd2465eebcb1872455254fa7a17ce21 | # 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... |
cf0735a3c5e18c9d0de1417fd811593cc032f5f54325f834c1c26252f716fdec | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base NDData class.
from copy import deepcopy
import numpy as np
from astropy import log
from astropy.units import Quantity, Unit
from astropy.utils.metadata import MetaData
from astropy.wcs.wcsapi import (
BaseHighLevel... |
b5d17a1ad08c7cb6d1d4960a88742be6332655bdf0cbc4fada36822eb04f8ee0 | # 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... |
d60ed6a9a05040d02b0613869aac7a2667b8158bff67d4e8865a2b03f6a9482b | """
A module that provides functions for manipulating bit masks and data quality
(DQ) arrays.
"""
import numbers
import warnings
from collections import OrderedDict
import numpy as np
__all__ = [
"bitfield_to_boolean_mask",
"interpret_bit_flags",
"BitFlagNameMap",
"extend_bit_flag_map",
"InvalidB... |
7cab855d7c4aec9870202fbb4224af4dcd0641c3410fc92e9247adaa40c53a00 | # 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... |
60175df71be70f27ddef45fe825a47fb8ddd9f101b37c89e130ede88ae352648 | # 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 astropy import log
from astropy import units as u
from astropy.io import fits, registry
from astropy.utils.decorators import sharedmethod
from astropy.wcs impo... |
da7d7a23025c0b3a5c24a63fffce49039e4d37f5a0e7abaa31efc053e5333fc2 | # 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.
... |
818415da6c0f5f9819c1a5f897212a15a79689fd78b817eef21658da151e7c1f | # 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.io.fits.hdu.image import Section
from astropy.utils imp... |
d65269af235aa89d993fdd8c4f18cb180c613c968c725f3bfd6887b15abccc82 | # 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 import log
from astropy.units import Unit, UnitConversionError, UnitsError
from .flag_collection import FlagCollection
from .mixins.ndarithmetic import NDArith... |
4f7be642a314762a4b83bd439a20bab8969758db968678a0cbcd3838e9bf1d07 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements a class based on NDData with all Mixins.
"""
from .mixins.ndarithmetic import NDArithmeticMixin
from .mixins.ndio import NDIOMixin
from .mixins.ndslicing import NDSlicingMixin
from .nddata import NDData
__all__ = ["NDDataRef"... |
44e9551cbd95d73ff0c480b6c01e45cb582a444b182fb7e375cd62133fe194ba | # 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("se... |
46782f5c25067fe05d6c5688459c9cdedfb9522a5bdc12632d1de0d711541ea3 | # 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... |
012e559477ed07457f4b6944385c7e4b56b7d5cb9cb7c89f03214a15a7bcd8dc | # 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):
import argparse
from . import wcs
parser = argparse.ArgumentParser(
description=(
"Check the WCS keywords in a FITS file for com... |
ce55b80cd7800a1260e4323b868387af6ad334d4c9eb1cac0b0330fb8c8fc170 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
import os.path
import shutil
import sys
from collections import defaultdict
from os.path import join
import numpy
from setuptools import Extension
from setuptools.dep_util import newer_group
from extension_helpers import get_compiler... |
c4e0b28537ac785a9583470411956fa548918074175d7ce86977265ecb9fa3a8 | # 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 ITRS, CartesianRepresentation, SphericalRepresentation
from astropy.utils import unbroadcast
from .wcs import WCS, WCSSUB_LATITUDE, WCSSUB_LONGITUDE
__doctest_ski... |
10b285fdb4a2587ce95edb6798f6ad744cb92f12babc1aae3fc8c8f0edbcfc65 | # 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... |
ea4950b8f5db8e9af8d1fda7aa2d7f99426a1e178ec5ea23329eb154337edcd8 | # 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 ... |
c16edf228eaea31a9321e28f7fbce7fed62cbb2663c44225f9de820ab2a88b67 | # 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
astronomy.
"""
import copy
... |
3518d62684f1d71ec7c02f0ad6052740b3363b1a51cffb08f3c40fadf1cc332f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.table`.
"""
use_fast_parser = _config.ConfigItem(
["True", "False", "force"],
"Use fast C parser for sup... |
683ff98e743aa52ec62cf78c10d3e21773bf03f1b948bac139cdf92722b58865 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Copied from astropy/convolution/setup_package.py
import os
import numpy
from setuptools import Extension
C_TIME_PKGDIR = os.path.relpath(os.path.dirname(__file__))
SRC_FILES = [
os.path.join(C_TIME_PKGDIR, filename) for filename in ["src/parse_t... |
1330c34a95e573d978fc2dc145b2b1ef373f0ea4e71086368d3d7cba2a279dc4 | # 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/papers/robustr.pdf
Furtherm... |
6a01dc6d8fdc79250d7014d86691ea86b65f76deda524e1818cfbb963c4befba | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import datetime
import fnmatch
import re
import time
import warnings
from collections import OrderedDict, defaultdict
from decimal import Decimal
import erfa
import numpy as np
import astropy.units as u
from astropy.utils.decorators import classproperty,... |
b93311975bb33ec8fb1987da6eae2a9271d0e1f7f27ca58d9d90c2f801c8a397 | # 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,
add_en... |
05c30fa47e7b60ba674d3d05c7b2896c54d4895292988adfe82661b5fa63029e | # 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.imperial.mile / u.hour
... |
26b88bae51dcc8132022fd94c457dda7d3c3d47b4a574735e612fa9165d4d506 | # 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/vizier/doc/catstd-3.2.htx>`... |
a472262da80ebae6abe61f38a28dc28413c22dea65792b91823623be6c2aed5c | # 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`).
"""
import numpy as _numpy
... |
38ac1fad2ffa5b4cb589185d3cbf48400217930a085065337841d452b53359f0 | # 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... |
03c34c33968e0e4b24a5fe9489965344c35ae5d333392896b36e3b830c4aa071 | # 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
`astropy.units.deprecat... |
c52e19a3adb5762e8b32809390b0864a512a33b535fb5176ce8baa29108a6e78 | # 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... |
0b8cddf43dafe9293cf004e572868a37b453f11984bde902abc66d1b76873054 | # 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, def_unit, set_enabled_units
# To ensure si un... |
c11209465d4aa2dfe16b92cda20cee9f0b4513bf025e3c4388ee842b8a04ebf0 | # 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 # for bkwd compat #11975 and #11977 # noqa: F401
from . import a... |
a8b0bbc1873183af19fcd145a8e810c39f78f5c90c8fb3bf7f556a6ac14e7bb9 | # 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)... |
bd5e8cb2c3549b43a67515b7197679a4b943e36ebb945a2cd2fb7ffe702224c4 | # 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", "centimeter"], si.cm,... |
902ed64f883d27f947a522b254803eacd610d10a6eb9ca03b2d6764d245fdc44 | # 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 * # noqa: F401
try: # py 3.9+
from typing import Annotated
except (ImportError, ModuleNotFoundError): # optional dependency
try:
from typing_... |
24a9a4ad0c2fa1bf7e1fa36f0c9d296ce00a63dbb6005ac4a6c07556378eec29 | # 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 deprecated
>>> q = 10. ... |
4cfd8dfdcd56d9728ccc887c874772889a43a7232f42723efada453fa640b5a9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines structured units and quantities.
"""
from __future__ import annotations # For python < 3.10
# Standard library
import operator
import numpy as np
from .core import UNITY, Unit, UnitBase
__all__ = ["StructuredUnit"]
DTYPE_OBJ... |
359e348abc8561c0b0df4b64834733cd2ab16b0febfea4d8b10dcd43109ee93a | # 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 numbers
import operator
i... |
8e4d41ef6532ab8f26d9dba5ddbb85f468186ea21d550df2e6d8204f48207783 | # 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()
#########################... |
f0f483a373faab6a60bdfe8179331398fa63d38711dc91587bbb12c044d68f94 | # 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_enabled_units, si_prefixes
... |
776c1620a9b31995b54606dd7d4b43a3f0fde71d0608fd0295bcf23bdf5daf0a | # 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... |
ebec50a44f16ede2acbb5919ac6bff2351dae55762fc2c4c5f86ccf81019adc7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions for retrieving solar system
ephemerides from jplephem.
"""
import os.path
import re
from urllib.parse import urlparse
import erfa
import numpy as np
from astropy import units as u
from astropy.constants imp... |
e8fa6a11f6e7b74b766988f6770fe28d7d9e46c20cfb294d588c6196e2768656 | # 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.py build_ext --inplace
#... |
101753ced94cd0bc0e6b80c0d21a8967a87cc42300e1d9d061f89783a1a45a40 | import warnings
from textwrap import indent
import numpy as np
import astropy.units as u
from astropy.constants import c
from astropy.coordinates import (
ICRS,
CartesianDifferential,
CartesianRepresentation,
SkyCoord,
)
from astropy.coordinates.baseframe import BaseCoordinateFrame, frame_transform_gr... |
f1d77a3fb884a7776681e0258e9022e5608bc1f076b11c4c24043f7e9fc78a0d | # 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",
"IllegalSeco... |
50c97f97d1637f06e6e862554f0161266c05b993e3be8bde5177d749e98ba51e | # 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 astropy.utils import deprecated
from .angles import Angle
@deprecated("5.2", alternative="@"... |
a021a6569598653873018bf16bbd1e33610ea80f190b57503fae0069da29abfa | # 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 .angle_utilities import *
from .angles import *
from .attributes impor... |
8e00152754bff2cb15bc3b3a864e5b31c8569a40ca58154efd3f9dd5bcb54083 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for matching coordinate catalogs.
"""
import numpy as np
from astropy import units as u
from . import Angle
from .representation import UnitSphericalRepresentation
from .sky_coordinate import SkyCoord
__all__ = [
... |
9e3265a47231656c2ab1f5774d527453f1167852578420db6428a642786d224c | import copy
import operator
import re
import warnings
import erfa
import numpy as np
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.table import QTable
from astropy.time import Time
from astropy.utils import ShapedLikeNDArray
from astropy.utils.data_info import MixinInfo... |
92691afebd09f06b2071ba4a8743428caf60e9c248e4958780130a830a66279a | # 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... |
09e59e081b946a94301b241bc88459a881eea48908efc632afca432be6602205 | import numpy as np
from astropy.units import Unit
from astropy.units import equivalencies as eq
from astropy.units import si
from astropy.units.decorators import quantity_input
from astropy.units.quantity import Quantity, SpecificTypeQuantity
__all__ = ["SpectralQuantity"]
# We don't want to run doctests in the docs... |
7831e9812a3892bafbd44755b593df060d2b882103a04a8526bf99a1b01f06c0 | """
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 inspect
import operator
import warnings
import numpy as np
from erfa import ufunc as erfa_ufunc
import astropy.un... |
1cbcc169133385b0ea24f4ab378f288f9b0587403fcdc31b9aa10e12b8d4cc08 | # 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... |
e37a830d4530e06914a7afe73363d05645d4ee22ea3a4f7206f4e17aa15a1071 | # 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",
"golden_spiral_grid",
... |
fc76e505fa86f993c6d6ef08d6a8fcd020c900d6c12666f8a23c212ba2d9459e | # 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... |
a93fe72a38caa22581ab906419bc9c271fa9a1fc39433c0883a630b5d45fff7c | # 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
__a... |
811add90be46b33332044177bea94bfd469ca7bafe5002325ea3ffaa38a11228 | # 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... |
0d9c20862b7712d41fa097315488940da6e3b94ca2437c8fde718fbe41d8ed4a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import re
from collections.abc import Sequence
import numpy as np
from astropy import units as u
from astropy.units import IrreducibleUnit, Unit
from .baseframe import (
BaseCoordinateFrame,
_get_diff_cls,
_get_repr_cls,
... |
7cb4c09eeafe2a1287a7826b94719fde5fc79777ccf433e2fc551a7bdc280fc5 | # 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
import warnings
from collections import defaultdict, namedtuple
# Dependencies
import numpy as np
from astropy import... |
d7707f5a6e9087fe9e8443d70c264508918e4f339eea5e5ac40458a3b09ca82b | # 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 erfa
import numpy as np
from numpy.polynomial.polynomial import poly... |
08dad3ac32c5e77444eb43d49f5327cdc9e66f9f9989f687b4c7ab2a0c500366 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import collections
import json
import socket
import urllib.error
import urllib.parse
import urllib.request
from warnings import warn
import erfa
import numpy as np
from astropy import constants as consts
from astropy import units as u
from astropy.units... |
2bccb7719e04e80e8c34c531db09d8315a3f0976ce221e72721084ae009447bc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the fundamental classes used for representing
coordinates in astropy.
"""
import functools
from collections import namedtuple
import numpy as np
from astropy import units as u
from astropy.utils import isiterable
from . import... |
40555a0703dadc1b68b802ddccd34ce34f7fc11c0a7cd296049c707916c280ff | """
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)\.... |
fdcc14fcdc57eee3dcad754c14eb9ea6b3e33b4b5a80cb0b467be982cfb468df | # 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",
"CoordinateAttribute",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.