hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
1766743b590f2bbe15c9fb6570dc9964311ff1ca83d584a84b61507bc7c32785 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains models representing polynomials and polynomial series.
"""
# pylint: disable=invalid-name
from math import comb
import numpy as np
from astropy.utils import check_broadcast, indent
from .core import FittableModel, Model
from .f... |
01e7b4984b337aab8f0cd936ccbde4fe486e884803ffbfa16d3ab61df806a197 | # 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 .... |
0e07f74b02cefb0ead659d48d4e6c449abec33b0b138ee4fc96d7deea10f5863 | # 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... |
deb1ec9be6ddd15e8e3740b83fdf250cc8ec1d70bad5d06c140dbe764dd6487a | # 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 Magnitude, Quantity, UnitsError, dimensionless_unscaled, mag
from .core import Fittable1DModel
from .parameters import InputParameterError, Para... |
c67177e202b2bbfcec6c8f0fadfe0f7812e9bfba8c50f2246a3986ee75125481 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import os
import queue
import select
import socket
import threading
import time
import uuid
import warnings
import xmlrpc.client as xmlrpc
from urllib.parse import urlunparse
from astropy import log
from .constants import SAMP_STATUS_OK, __... |
1b7711ff0b710dd7ce8849f75d3014665038bed8e6bc5c79545a762f49338468 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: this file should be refactored to use a more thread-safe and
# race-condition-safe lockfile mechanism.
import datetime
import os
import stat
import warnings
import xmlrpc.client as xmlrpc
from contextlib import suppress
from urllib.parse import ... |
4e201e9f0c789de06c7fb3773017e357699b805ae4dc547e495c0c08962ea156 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import argparse
import copy
import sys
import time
from astropy import __version__, log
from .hub import SAMPHubServer
__all__ = ["hub_script"]
def hub_script(timeout=0):
"""
This main function is executed by the ``samp_hub`` command line to... |
40e84d2cf0653036bae08f61cce55446b3b76b2497c7def3ebc99fa17abfa9f0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines custom errors and exceptions used in `astropy.samp`.
"""
import xmlrpc.client as xmlrpc
from astropy.utils.exceptions import AstropyUserWarning
__all__ = ["SAMPWarning", "SAMPHubError", "SAMPClientError", "SAMPProxyError"]
class SAMPWarni... |
d1db8e1a31564f4032d940b80a705870388b9dac9f5d0e585bbd6a4754b1216f | # 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... |
e075854903974245a2b8fdcc9dbe9025bcd3252d1c832135de975f7c5eeb6530 | # 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... |
b4d7bba433bbc8d953adde59e5aa9b763b6f84bea1441e4c1878acd4c094f7ec | # 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... |
fc3b96dccb8824dd2a52ccd946a0da43cf9c528bfd6400405c9fcd7d401d63c5 | # 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
d... |
5dbc2361dcace124723405b1999c6ca955146d85868b64bc42e3416ad3e6cf99 | # 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... |
2be0d27e6df82b3f077cfdaf74950c2a381abd0390770b50f400e4f3486a95bc | # 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... |
34d51c0d53269a55a5b3d416ce6f631765f98b22acb4529b0ce8ced44a7cb0e7 | # 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... |
02537eb8495a99f55fd2c407e105d425bf3767e37a7bb2ee543892f23b4b28e8 | # 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... |
4fd9ad2203ab518312f9e763b4404007f57c27e35d231e1dc0a369bbceffd93f | # 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... |
466b71c69ab17f94e293d895cdd77bb3df0cd40491adb1c40d52d71fd9053942 | # 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... |
ae7e2bcd7258ac94145d4b375409a1baa0dfb017d0dbf407d4eaa296076d8031 | # 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... |
3422774b3d8c28eb3dd3fae151133b602747307be2b383d117e572ca152e6415 | # 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.... |
84baf3fcf99d2bee1f06d2d241019adf614f5a41c0cad7f3e36ae9ad086a7d36 | # 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",
... |
5a247ebaf8d7330bc3ec083405bfb0eae618faaf8c2ade346d4881467e66655b | """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).
"""... |
1ec8387ea2e7af8d72a5d6640dce80b33e229834cf8d468c02e2b476813984db | # 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... |
7c6b22da5d2ef3aeb6fb35f7aaf66fdf7a45f3ce802fc35c9e306f09614a2ce5 | # 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 ... |
404b70fa52a57082befafcba5ee29f507e5f8e987f4d14de53282f4f3be6fea1 | """
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... |
9ef96f1265399e64a56fd65d870d4c70e2f27e06330272fc746829ad6a6ceab8 | # 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... |
66df11d64091ee5c31814a59dedac0ec1d2214c718735e9c280d1d2c21974f01 | # 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... |
b235b81a0f598de64bb491da82cff557f70f6bfa25466d729c099d5854c5fd40 | # 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... |
cfb3412bbc681023cd3960664d922639e939bd40d03aff04f1b4f731dfcf17b8 | # 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
algor... |
7133cca6cc7d224672373e1e60008577b1798176911bb951d37807810794aefd | # 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",
"Line... |
0a34b14dd84b056db97a3059547119bd78422940d39153e9adbd3450e07ce5b2 | # 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... |
d7ed85ff2a75622088290f756b02b087ec9146b9d6124bf032456762bec353c7 | # 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 SlicedLowLevelWCS ... |
c438ba234bb52b6fb7244195e9449f93ee756cbe73b8e77b008cf4adf5d01cda | """
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... |
bf21a20339d3cee05ca25d1805b8f235c3b854aff9927b2ea31b21e40a2fedff | # 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... |
b283411de00f1f41ac6635d9c91619df8dc90f8062fc5f894436d81bb65abc8f | # 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... |
41b03d31c41ee8aa36db720f0f65dc690561a83c9dab1c5988fd2fdba17c5d04 | # 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 # noqa: F401
from .flag_collection import FlagCollection
from .mixins.ndarithmetic ... |
248c164aff2ad3e5ac74d2180ad0c91a9a4c85a1c6e04d0296ea0fb51f7de169 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""World Coordinate System (WCS) transformations in FITS files.
.. _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.cal... |
884d5577579f0253794813db8501e4f637a1f9fa0c6040f0cf7e4a70a8dfd28a | # 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... |
adb135b4458ee8d392d9b6d59c5e33c82bce8cb8da87fb98b8589b276cf171d0 | # 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... |
3bb46bb03d606bd1a1624948b981b2a63d3e536d05e840f7924b9751579c3481 | # 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
... |
92782595643ddd4df64e1b9ca26d73b41e352adba5859adb1ee70bfbc4502f0b | # 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,... |
a89659abb1a596f721f3ea0ee0fd770e071017ffc80a2a128659cececd822f89 | # 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... |
ba003f54bef2e96adbef3ee3688f0d4e6f2d56716b0c707958f325accb668e3c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Colloquially used Imperial units.
These units 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
>>> mph
... |
11ca0e7dcf3403770be72dd1d20ae8202e6d3e9d05f800a4fd5bf4725941b234 | # 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>`... |
92e52d276c1cd96c9b3c9e754d48ed153785c7f09b7221c8d2c227b99a971b49 | # 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 i... |
07588d32c4a59a7af72b6e0ea5d8d918212862fab7841d5565835b1780d90e3c | # 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)... |
0024f1846e89b0a915b9078add64a6b4456d76c185ce51e19c90e7e75a16a439 | # 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... |
b657974d6d8bbbbc70216e32e162b98a9ade66fe2ba900981e1854b5c340dd3d | # 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... |
f2076a069cddb78e0b7cd0d53052b861e617b26b50da5945bc10e2b94a8c7568 | # 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... |
d9568adcc9cbb67de4009167fef4821983fc7aa71c7fbbab1e225bc2107e0292 | # 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... |
dd9283fa054b5d60fb89c3db36577a441e860c825a7880a214e870928a5eac3d | # 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
#... |
c68a95c1747c1a01d6bd01d7fa1aefb2a8116dab6bcb3eaa0faa7d8ce89040b7 | 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... |
bc7cc28f54cd36935454c70af383f01ba214c217ccfd9b8834c6581a4012bc85 | # 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",
"IllegalSecon... |
4062e13ea89a15b881ee2fbb3606686ed6e4eae6492a0a59a0581d2c2430a822 | 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... |
dcb56b715721eafe8f288fd2214734d57432b0ca0c54a3820c6a90ebdaa98964 | # 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... |
716bb7185b19f78b4e1442bbe39a74c3b9759ba793e85bfbfe7d3d93648c5d40 | 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... |
bd17562fb365ed4ab74985f660a2aa3c6d24a1241a169a72972a2499df5ef78d | """
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... |
86453ef42493ce11e189012ccb3fbf4e07da027200126720fa7c4a3e2bbb500d | # 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... |
4f9414817a533a9b28a08efe77859956092b5a0779197d8e4523b8a86342562b | # 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",
... |
7a94e29ded42f22b460e734ea699434cff9eae93f2b667921b59b42dd39b76bc | # 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... |
12c57f8fe8773f1a7a19692b54eee1ccc262c94369c11a2774258421f5a14299 | # 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... |
677ecccc971b8d802ac3a4f473cd0909ef53969930889baeea60b69293fce697 | # 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,
... |
bf128fb008c5eeaf188f691af269b8a73b49756b89e269fe7b30ebdf8a4bb48b | # 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... |
e5377a5214016c43d55f7e4e8b69cfb433a2dffa46a7ff640e1be5b6eecb54cc | # 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... |
009211c93533edbb58ec7532a456fec2b9ae6127a57e54378ff8890735d9a2bc | # 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... |
71c08d66c134fb21cc4c8046002ac6f796843b0a0ee9ccecd880dacdc383a42b | # 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... |
98cbb7d902e2547f7a5f89c021b3ad08a3a3294b26ee364c0782fb2100c61272 | """
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)\... |
84255d65737e3ce877a55dee19fc0c20b87977254577042ec0bbd3a068042937 | # 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",
... |
c81c168c1bc9a9a8aa7b5d079b8b2d61b0771657913b3402d6044542aeec36f0 | # 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 erfa
import numpy as np
import astropy.units as u
from as... |
5ac4a6865b7871afa640860283e649b1a86a1ceedfe165c55feb5c7cbfe7c984 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains standard functions for earth orientation, such as
precession and nutation.
This module is (currently) not intended to be part of the public API, but
is instead primarily for internal use in `coordinates`
"""
import erfa
import ... |
ad70630025d0825ca8cb1d5398883578d2b97ee14ecb0e0ca0992535782afa30 | """Implements the wrapper for the Astropy test runner.
This is for backward-compatibility for other downstream packages and can be removed
once astropy-helpers has reached end-of-life.
"""
import os
import shutil
import stat
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from setu... |
4985990b09a0d493662ca03d8dd6f87c1d07244310b79eb563ba8ccc6f91154d | """Implements the Astropy TestRunner which is a thin wrapper around pytest."""
import copy
import glob
import inspect
import os
import shlex
import sys
import tempfile
import warnings
from collections import OrderedDict
from functools import wraps
from importlib.util import find_spec
from astropy.config.paths import ... |
b68fac154d05043b57d2d60cd69238423708851a92aa6a39725b1f696475048f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides the tools used to internally run the astropy test suite
from the installed astropy. It makes use of the `pytest`_ testing framework.
"""
import functools
import inspect
import os
import pickle
import sys
import warnings
import py... |
2ad32613e11daa3c5dd5b79f0e2ef4cb2172db925860bc94a297d7a00cbee88b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.table import QTable, Table, groups
from astropy.time import Time, TimeDelta
from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns
from astr... |
666ee2a10fdcdc4613c70db695285881e48d1f56589ce30e040d4d0bfb8d99fb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy import units as u
from astropy.time import Time, TimeDelta
from astropy.timeseries.binned import BinnedTimeSeries
from astropy.timeseries.sampled import TimeSeries
from astropy.utils.exceptions import Astr... |
e8d516479e7ea83a0caeb5a8e129b4cbd82ca94ac2049fffa6b8e78c4e83b0ce | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.table import QTable, Table, groups
from astropy.time import Time, TimeDelta
from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns
from astr... |
a7d672f77e37011b146d6780a5653789fe4ec24bbb16d5e1816bd462de16f48d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utility functions for ``constants`` sub-package."""
import itertools
__all__ = []
def _get_c(codata, iaudata, module, not_in_module_only=True):
"""
Generator to return a Constant object.
Parameters
----------
codata, iaudata : ob... |
0542d2c966179e9369baacc239e19f5b9eed809c34c9c6b668c5dad6097a1f7e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import types
import warnings
import numpy as np
from astropy.units.core import Unit, UnitsError
from astropy.units.quantity import Quantity
from astropy.utils import lazyproperty
from astropy.utils.exceptions import AstropyUserWarning
... |
37723d9547d3f850bd13306a4594f47f337b4b3532dfba99629afdbc90b5de9e | # 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 example... |
7bc4c9109d80d3c0e5a7ef58d412ee5528edb1a7d3ffb0d95a6e8f1c50d63a40 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_equal
from astropy import units as u
from astropy.stats import funcs
from astropy.utils.compat.optional_deps import HAS_MPMATH, HAS_SCIPY
from astropy.utils.misc import Nu... |
4951c63a14f55c56e028ae03123a542245a9974529a8042ee9a2a2c22c0701dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy import coordinates, time
from astropy import units as u
from astropy.table import Column, NdarrayMixin, QTable, Table, table_helpers, unique
from astropy.utils.compat import NUMPY_LT_1_22, NUMPY_LT_1_22_1
fro... |
aa221e7801fae23aa46f638cccf412851ca5a35e7d2413e1ab4e5e26f38e5b72 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides functions to help with testing against iraf tasks.
"""
import numpy as np
from astropy.logger import log
iraf_models_map = {1.0: "Chebyshev", 2.0: "Legendre", 3.0: "Spline3", 4.0: "Spline1"}
def get_records(fname):
"""
... |
3df9e30d1478a26284fac538213a426d647d66e00cb0187559938641427765bc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to test fitting routines
"""
# pylint: disable=invalid-name
import os.path
import unittest.mock as mk
from importlib.metadata import EntryPoint
from itertools import combinations
from unittest import mock
import numpy as np
import pytest
from n... |
9b0a7bdeec2c075c15b5cdce4a0905c9a0cd5db2bbe7bdb59c45e90f1236cb71 | # Licensed under a 3-clause BSD style license - see LICENSE.rst:
"""
Tests for model evaluation.
Compare the results of some models with other programs.
"""
import unittest.mock as mk
import numpy as np
# pylint: disable=invalid-name, no-member
import pytest
from numpy.testing import assert_allclose, assert_equal
i... |
cd34904d3309991e4dcf6209687d5eb3d1a272893e29d14954e821f303472dfb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import unittest.mock as mk
import numpy as np
import pytest
import astropy.units as u
from astropy.coordinates import SpectralCoord
from astropy.modeling.bounding_box import (
CompoundBoundingBox,
ModelBoundingBox,
_BaseInterval,
_BaseSel... |
0dc5630efd50c1221d98235b9523b91bcd9ae7d6e18c2f9758bee9797c826bf6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
import os
import subprocess
import sys
import unittest.mock as mk
from inspect import signature
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_equal
import astropy
import astropy.modeling... |
64991a92b38c2541c26321ffa0ee7d8d16ce2a4611009cfe458906a93840243d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for physical functions."""
# pylint: disable=no-member, invalid-name
import numpy as np
import pytest
from astropy import cosmology
from astropy import units as u
from astropy.modeling.fitting import (
DogBoxLSQFitter,
LevMarLSQFitter,
... |
cb761210464a5ad3782e1a9f14c91d11f09aeccd4706d7609a9ad73491f3c69b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
import platform
import types
import warnings
import numpy as np
import pytest
from numpy.random import default_rng
from numpy.testing import assert_allclose
from astropy.modeling import fitting, models
from astropy.modelin... |
7d0793a553420d5fb1da0b5bddca17d6efa60e2c43955043d2f18a3078db91fa | import threading
import time
import xmlrpc.client as xmlrpc
from astropy.samp.client import SAMPClient
from astropy.samp.errors import SAMPClientError, SAMPHubError
from astropy.samp.hub import WebProfileDialog
from astropy.samp.hub_proxy import SAMPHubProxy
from astropy.samp.integrated_client import SAMPIntegratedCli... |
512ab2afd7844c3e2207744f0f500c6b5f12af92dbb7d654fdefce8b59fb3871 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.utils.iers package provides access to the tables provided by
the International Earth Rotation and Reference Systems Service, in
particular allowing interpolation of published UT1-UTC values for given
times. These are used in `astropy.time`... |
8576015686639c17f824a12bcd32fa30561388f95b8d7cbb12a3945dcb293ac0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions to do XML schema and DTD validation. At the moment, this
makes a subprocess call to xmllint. This could use a Python-based
library at some point in the future, if something appropriate could be
found.
"""
import os
import subprocess
de... |
1859ef89a6762fb0944aa4bb1b9dc77c606c3fb2275e5a4705e2dc09264ddcc8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Helpers for letting numpy functions interact with Masked arrays.
The module supplies helper routines for numpy functions that propagate
masks appropriately., for use in the ``__array_function__``
implementation of `~astropy.utils.masked.MaskedNDArray`.... |
07488a9199bb4df3b99d6341c679050b70100b7f98bf9ad47234f9875a1673c6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a collection of monkey patches and workarounds for bugs in
earlier versions of Numpy.
"""
import numpy as np
from astropy.utils import minversion
__all__ = [
"NUMPY_LT_1_21_1",
"NUMPY_LT_1_22",
"NUMPY_LT_1_22_1",
"NUMPY_LT_1_... |
da4bc7380cc2853f9bc0516edae4cf2c58b9b4d96c28f1ad9df710b58637cea8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Helpers functions for different kinds of WCSAxes instances.
"""
import numpy as np
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredEllipse, AnchoredSizeBar
import astropy.units as u
from astropy.wcs.utils import proj_plane_pixel_scales
... |
dd4e33c2bea21f2f43589caaac3e269db4c4c99ff73ea94e6b9d525cb3a9af1f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Note: This file includes code derived from pywcsgrid2
#
# This file contains Matplotlib transformation objects (e.g. from pixel to world
# coordinates, but also world-to-world).
import abc
import numpy as np
from matplotlib.path import Path
from matp... |
28763df2a0e8bf6c8297f11b5b356d3fa0ddc3dd6a47a3fb2ddcbfa12a8b1588 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file defines the classes used to represent a 'coordinate', which includes
axes, ticks, tick labels, and grid lines.
"""
import warnings
import numpy as np
from matplotlib import rcParams
from matplotlib.patches import PathPatch
from matplotlib.... |
9758add9b394fedd9f27f1bc03a0e0d5271866d23d2cfb0d0fedfa773011ad66 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file defines the AngleFormatterLocator class which is a class that
# provides both a method for a formatter and one for a locator, for a given
# label spacing. The advantage of keeping the two connected is that we need to
# make sure that the form... |
84fc2e27aea5403bafc3c0b717103d2b8aaa5b6274e28dd3d4835fe0d6a48fd1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import defaultdict
from functools import partial
import numpy as np
from matplotlib import rcParams
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D, ... |
049e6d8f54e8ab05a45754d93c00c1a86228896356079647cfaae3b8eb128d59 | # Functions/classes for WCSAxes related to APE14 WCSes
import numpy as np
from astropy import units as u
from astropy.coordinates import ICRS, BaseCoordinateFrame, SkyCoord
from astropy.wcs import WCS
from astropy.wcs.utils import local_partial_pixel_derivatives
from astropy.wcs.wcsapi import SlicedLowLevelWCS
from ... |
cfc31042b07f463c8316f905a9014c699ac846d9c4c26a6eb9ef0eaff6f316d8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from matplotlib.patches import Polygon
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.coordinates.matrix_utilities import rotation_matrix
from astropy.coordinates.representation i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.