hash
stringlengths
64
64
content
stringlengths
0
1.51M
1fbd748eeec641153888a7435a55159f60c46a242d382b8ce916559b050a7eb5
# Licensed under a 3-clause BSD style license - see LICENSE.rst import collections from collections import OrderedDict from operator import index as operator_index import numpy as np class Row: """A class to represent one row of a Table object. A Row object is returned when a Table object is indexed with a...
822859fb9649f71241b45e07077a08d012d8f902d9a2ddc42ec44013a76182bd
# Licensed under a 3-clause BSD style license - see LICENSE.rst import platform import warnings import numpy as np from .index import get_index_by_names from astropy.utils.exceptions import AstropyUserWarning __all__ = ['TableGroups', 'ColumnGroups'] def table_group_by(table, keys): # index copies are unnece...
fd48aa22753dc157fb44c60364198ea2e5fc25b00a40e81cf6bb3b3fe6951d8e
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .index import TableIndices, TableLoc, TableILoc, TableLocIndices import sys from collections import OrderedDict from collections.abc import Mapping import warnings from copy import deepcopy import numpy as np from numpy import ma from astropy impo...
3343bd9598a924ba96455d41cbadb2be4ba40d0eb62d0824a741804aa878724e
# 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`. """ auto_colname = _config.ConfigItem( 'col{0}', 'The template that determines the name of a co...
e5276889cfe5c089e04d63559b00a6f717a12d5491f96f6fdc6cd2479cb2c324
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import weakref import re from copy import deepcopy import numpy as np from numpy import ma # Remove this when Numpy no longer emits this warning and that Numpy version # becomes the minimum required version for Astropy. # https://github...
0ddadda3a192107725e94da6fc0341042d085f43a807a330f45a3b16e3d78d87
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys import re import numpy as np from astropy import log from astropy.utils.console import Getch, color_print, terminal_size, conf from astropy.utils.data_info import dtype_info_name __all__ = [] def default_format_func(format_, val)...
9547b7486661c30c931309628fd13e1b84bf86eb9204371a9ad9678f76bf7e6b
""" High-level table operations: - join() - setdiff() - hstack() - vstack() """ # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import collections import itertools from collections import OrderedDict, Counter from collections.abc import Mapping, Sequence import numpy as np ...
abc68a54482657d503ccb62fc66a6e26e81ea43cad5485b50edf0531b3ba3696
""" High-level operations for numpy structured arrays. Some code and inspiration taken from numpy.lib.recfunctions.join_by(). Redistribution license restrictions apply. """ from itertools import chain import collections from collections import OrderedDict, Counter from collections.abc import Sequence import numpy as...
bf2bdff72f309f88ed22e3b3f513ffef46494819e05914a9c79ca3c091ecd30d
import textwrap import copy from collections import OrderedDict __all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table'] class ColumnOrderList(list): """ List of tuples that sorts in a specific order that makes sense for astropy table column attributes. """ def sort(sel...
cdb2ff1d70ebc42d40db182245525f4e887562592e27adcd6dd680d0a33775cb
from importlib import import_module import re from copy import deepcopy from collections import OrderedDict from astropy.utils.data_info import MixinInfo from .column import Column from .table import Table, QTable, has_info_class from astropy.units.quantity import QuantityInfo __construct_mixin_classes = ('astropy.t...
74cc8e9ce831fce0eeb9624ac3dfae6455462aa38f99f25769a55f875bf132fb
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Helper functions for table development, mostly creating useful tables for testing. """ from itertools import cycle import string import numpy as np from .table import Table, Column from astropy.utils.data_info import ParentDtypeInfo class TimingT...
4220392fcb20ca86cb27316da8665ca71f58066d7876cb6beb271692a58b409b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import math import numpy as np from .core import Kernel1D, Kernel2D, Kernel from .utils import has_even_axis, raise_even_kernel_exception from astropy.modeling import models from astropy.modeling.core import Fittable1DModel, Fittable2DModel from astropy...
b61251292cc29cb25fd6ddfa2fcca78ff03612c91ce20db36734c50c1992ca46
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the convolution and filter functionalities of astropy. A few conceptual notes: A filter kernel is mainly characterized by its response function. In the 1D case we speak of "impulse response function", in the 2D case we call it "po...
73cab06c1c9561ea68b15ca59d2fd1031c21a5e6efdc4f83be935e0e3782a616
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .core import * # noqa from .kernels import * # noqa from .utils import discretize_model # noqa from .convolve import convolve, convolve_fft, interpolate_replace_nans, convolve_models # noqa
f0e22277df0303b2ac5d7736b4542004494e4129db8a47912dd6d3cf26907446
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys from distutils.extension import Extension C_CONVOLVE_PKGDIR = os.path.relpath(os.path.dirname(__file__)) SRC_FILES = [os.path.join(C_CONVOLVE_PKGDIR, filename) for filename in ['src/convolve.c']] extra_compile_args=['...
1bf3b3ec948f88c83b0c7f3a7a12c52cf6a6e06248bc0e45f0dd247827428670
# Licensed under a 3-clause BSD style license - see LICENSE.rst import ctypes import numpy as np from astropy.modeling.core import FittableModel, custom_model __all__ = ['discretize_model'] class DiscretizationError(Exception): """ Called when discretization of models goes wrong. """ class KernelSizeE...
22bf466d6a80fc847e40b41a641002b67049a7c1e1f34c677dcc42cf7bb01ca7
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import os import sys import glob import ctypes from functools import partial import numpy as np from numpy.ctypeslib import ndpointer, load_library from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION from astropy.utils.excep...
6fbb4d9ca54c91d8601c066970dc682c16daf58eee2949ee6bfed8ac29ba6db3
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains classes and functions to standardize access to configuration files for Astropy and affiliated packages. .. note:: The configuration system makes use of the 'configobj' package, which stores configuration in a text format li...
6afb00688d8dfc94f66e040a788a20d49faa1491e10a166550c8296c609f863d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions to determine where configuration and data/cache files used by Astropy should be placed. """ from functools import wraps import os import shutil import sys __all__ = ['get_config_dir', 'get_cache_dir', 'set_temp_config...
4905249e1ddb7e8bee39ca2bc523786688c9b6d177aedc65752d6679e9d61048
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Distribution class and associated machinery. """ import numpy as np from astropy import units as u from astropy import stats __all__ = ['Distribution'] # we set this by hand because the symbolic expression (below) requires...
d484791f5a84387b2f96a702aac42c7b9e755a142ddfbe02bfed1ec8a7eb3b20
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Built-in distribution-creation functions. """ from warnings import warn import numpy as np from astropy import units as u from .core import Distribution __all__ = ['normal', 'poisson', 'uniform'] def normal(center, *, std=...
c8a90cce8ad8facbdf36a1c7ff8464dd2a530c9ea4df9009dbdde2383010aff4
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This sub-package contains classes and functions for creating distributions that work similar to `~astropy.units.Quantity` or array objects, but can propogate uncertainties. """ from .core import * from .distributions import *...
cba1433a6b06778d8622a4e333821d974d788a467b25eaa2a9cc40b515c7ef65
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements classes (called Fitters) which combine optimization algorithms (typically from `scipy.optimize`) with statistic functions to perform fitting. Fitters are implemented as callable classes. In addition to the data to fit, the ``__c...
251de86c7203efa79f2956c8801d88a4b5774868c02e02ed5d70e5ec1cadae09
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines two classes that deal with parameters. It is unlikely users will need to work with these classes directly, unless they define their own models. """ import functools import numbers import types import operator import numpy as np...
4e5be679b6ccd91a0051256b23274511ef563aa1e90cea900e62782cd007f438
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines base classes for all models. The base class of all models is `~astropy.modeling.Model`. `~astropy.modeling.FittableModel` is the base class for all fittable models. Fittable models can be linear or nonlinear in a regression analys...
164fc98caf7232b739b43be3d4678a6571086f9051f150ea4d1c29139ae4db6f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Model and functions related to blackbody radiation. .. _blackbody-planck-law: Blackbody Radiation ------------------- Blackbody flux is calculated with Planck law (:ref:`Rybicki & Lightman 1979 <ref-rybicki1979>`): .. math:: B_{\\lambda}(T) = ...
13676feda99e5156a71211c44f73a921cb448f7fbdd2f0a3355ebcc86b5f0e0d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Optimization algorithms used in `~astropy.modeling.fitting`. """ import warnings import abc import numpy as np from astropy.utils.exceptions import AstropyUserWarning __all__ = ["Optimization", "SLSQP", "Simplex"] # Maximum number of iterations DEF...
73a618fcfe30190732bd1f58110b865d361cdcf42afd4bf573f357fe56063c4a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Implements rotations, including spherical rotations as defined in WCS Paper II [1]_ `RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in WCS Paper II to rotate to/from a native sphere and the celestial sphere. The implement...
5430ec4e328b32ed8fc6fba01c572105931718c7adf4dfe933ad5040084fbd27
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from os.path import join from distutils.core import Extension from distutils import log from astropy_helpers import setup_helpers, utils from astropy_helpers.version_helpers import get_pkg_version_module wcs_setup_package = utils.import_file(...
fd693409195f2efc647e91dffedba0bc2f43c2505c52952574dd09a7aad6f50e
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Functions to determine if a model is separable, i.e. if the model outputs are independent. It analyzes ``n_inputs``, ``n_outputs`` and the operators in a compound model by stepping through the transforms and creating a ``coord_matrix`` of shape (``n_...
385b9a625c19dc3c9aed80b57a3d808c30a375841372eb82d3ad382714cf995b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides utility functions for the models package """ from collections import deque from collections.abc import MutableMapping from inspect import signature import numpy as np from astropy.utils import isiterable, check_broadcast from...
56c1f607df8c400c57e8e85b1ea2238248f09de53e1004b4660cda3ce1ed9b0d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Mathematical models.""" from collections import OrderedDict import numpy as np from astropy import units as u from astropy.units import Quantity, UnitsError from .core import (Fittable1DModel, Fittable2DModel, ModelDefinitionErro...
f7bb103fbaacfb648d7ba82b0b426121868318e625152b46e50c76da2cd16a23
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ Implements projections--particularly sky projections defined in WCS Paper II [1]_. All angles are set and and displayed in degrees but internally computations are performed in radians. All functions expect inputs and outputs d...
00be02b0f8c4d8f5be621c6cd8d3c5eed2d190d40542a588035b9bd093156ad1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains models representing polynomials and polynomial series. """ from collections import OrderedDict import numpy as np from .core import FittableModel, Model from .functional_models import Shift from .parameters import Parameter fro...
c5dde8204f5d5af19f1c8aced3997190655b289c40fc0d0fa3f8ab94818c5476
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tabular models. Tabular models of any dimension can be created using `tabular_model`. For convenience `Tabular1D` and `Tabular2D` are provided. Examples -------- >>> table = np.array([[ 3., 0., 0.], ... [ 0., 2., 0.], ... ...
e320e7d65e7995b35468d39b05f763a7c1e401648e62ce031aebbad50b36ff3e
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Power law model variants """ from collections import OrderedDict import numpy as np from .core import Fittable1DModel from .parameters import Parameter, InputParameterError from astropy.units import Quantity __all__ = ['PowerLaw1D', 'BrokenPowerL...
02e4a61339b478c388b7f7e7e4792cab638c50aaf1243e9a3d035a2639a5d499
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import os import select import socket import threading import time import uuid import warnings import queue import xmlrpc.client as xmlrpc from urllib.parse import urlunparse from astropy import log from .constants import SAMP_STATUS_OK fro...
cb25e1d28da439ae5bbbe7dd62acb844be99948a900f3598d4f8f9825039038a
# 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 socket import stat import warnings from contextlib import suppress from urllib.parse import urlparse import x...
48256f74bd49fde16fd9a98a466d3d9a47d13ce75be8de52a44849049a9b67c6
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import time import sys import argparse from astropy import log, __version__ from .hub import SAMPHubServer __all__ = ['hub_script'] def hub_script(timeout=0): """ This main function is executed by the ``samp_hub`` command line to...
92ceaa5c1e62cdabe82ec0c125901076465055f1f4a7a6ed97b228797a101780
# Licensed under a 3-clause BSD style license - see LICENSE.rst from urllib.parse import parse_qs from urllib.request import urlopen from astropy.utils.data import get_pkg_data_contents from .standard_profile import (SAMPSimpleXMLRPCRequestHandler, ThreadingXMLRPCServer) __all__ = []...
109af8dfe5650f8c47e9ca5175875a6b398580a1aa47ad3ee1bc35e953dd02cf
# 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 Protocal (SAMP) <http://www.ivoa.net/documents/SAMP/>`_. Before integration into Astropy it was known as `SAMPy <https://pypi.python.org/pypi...
15bcedef467ba6ca937da6e95a4cbe5404d500b20c9f766498cd0e169d251845
# 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 .hub import SAMPHubServer from .errors import SAMPClientError, SAMPWar...
858bf67b329fee59492c4957fb8ce9b72fa0b9729ab424862cd8f8b12bac8d3a
# -*- 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 types import warnings from inspect import signature from functools import wraps from .exceptions import (AstropyDeprecationWarning...
31bf1c6a95300621689208585bc1d703926729b8eb46f1b39eb9bce38f8a1065
# -*- 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 try: import fcntl import termios ...
7c0ad779eb98c21eb310c362c7b5d96323f79d4b2d38d335fb6fb6122219d4a6
# Licensed under a 3-clause BSD style license - see LICENSE.rst """General purpose timer related functions.""" # STDLIB import time import warnings from collections import Iterable, OrderedDict from functools import partial, wraps # THIRD-PARTY import numpy as np # LOCAL from astropy import units as u from astropy i...
04e1fc6c9195cb0a4f499f7d463271bd609b9ee30029b10e6f7bdf8f349a5e23
# 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...
e45e5647600b45571f62374d82744fe95243dfdd8892a66005cb60ceca49b3e7
# 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. Exception is the _erfa module as we rather have the users ...
4ea86e31f8f0d4ab248e88c0ee37f5c8969041df0711c16cea8d461550e3151a
# Licensed under a 3-clause BSD style license - see LICENSE.rst from distutils.core 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, '...
e3bf2b11ed43e17da1b0b3251819db3f69e2fc476db1a4460af0fa5410cd4a6a
# -*- 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 ...
221dcbc89e52de33fc1b9f44a3fbe461874671026df97354d762b10f0165ee8c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains helper functions for accessing, downloading, and caching data files. """ import atexit import contextlib import fnmatch import hashlib import os import io import pathlib import shutil import socket import sys import time import u...
372ecc9c8c87667b7768399d02bc7ccaaca4e4e873ca4a79a8394583430ddc36
# -*- 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 t...
db03c9c7a8fd1f343d02f45b5cfb58d6743bb725a25f718d39a94f77120b6335
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handle loading six package from system or from the bundled copy """ import imp import warnings from distutils.version import StrictVersion from astropy.utils.exceptions import AstropyDeprecationWarning warnings.warn('astropy.extern.six will be remo...
d5e902aa06eb0b1d87750fd2d0c8facb73026701ffd646ca7a754d92b2b6f986
""" 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...
c4eb779f45bac686fd8d8f0c5a5904dce173ddd9aaa9bed8cde03a71796a2986
# 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 : http://adsabs.harvard.edu/abs/2004PASP..116..133L """ import numpy as...
20612cc4f14e7715a876a4ae831dd7d9dbb55893931e02d3bda7eb568579a2fe
# 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.misc import InheritDocstrings from .transform import BaseTransform __all__ = ['BaseInterval', 'Manual...
25dfc1ee4374e32df985a3948933c3db237bd10ab55e041b8a9578fdf02b8a80
# -*- 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...
b20453743078a62587d4dc6031afc0ee576330b9132a755e3d649bfad8f46ab9
# 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. from astropy.utils import minversion # This returns False...
f6b56d7f291ace9ea044df5ec6daf4d207ab53677ab27ea0ff2e8d535e8219fb
# 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...
abb693c394af8726a45061bad60d237c403a224cea498abef0fa77ad049d9aa9
# 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...
4be730304286e3306a020d0e8615b2d884cdf699b71429b7a10fb4c682002411
# 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 astropy.utils.misc import InheritDocstrings from .transform import BaseTransform from .transf...
f0d4f89ccd72f38dd891ccf0cea033108880243345ec952fc1b909416e30b3d7
# 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...
bba04011a1785eabce2e3c50b300bf80638d11a447a06f8e3c4d13def0130175
# 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 ...
28e2837dd98e3383ec4126b02da4d1a6e3800de203fa75089d74e89fad481c53
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .nddata_base import NDDataBase 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, UnitCo...
0cc06f75e992dd3689ffab2395cbcdcc7d4f5a5bc496daa9eb0115c7362eba76
# 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...
ec04fb156b4112892d6b2df1f89c7a5b01d304a856e83a092605feb5e8f42f5f
# 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...
da79e3beaa90a8b7ec3cdef68f104d319ee1f0096e09a8cf883c84a12b812aa4
# 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...
235f4383f5fe09d56b61960733522bc8b1ba2de97dcab7ca54c14dee8e68b821
""" A module that provides functions for manipulating bit masks and data quality (DQ) arrays. """ import sys import warnings import numbers import numpy as np __all__ = ['bitfield_to_boolean_mask', 'interpret_bit_flags'] _MAX_UINT_TYPE = np.maximum_sctype(np.uint) _SUPPORTED_FLAGS = int(np.bitwise_not( 0, dty...
98949557e7121c99450fbe222e4760a857a6dc988e8cfe5dd94d8dc158034f5f
# 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...
d06ae2ebf340e62f15cae3bb365dbd093f0ef073270b3c9776d5946311a7217b
# 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 .decorators import support_nddata from astropy import units as u from astropy.coordinates import SkyCoord from astropy.utils import lazy...
07f391ac338a4889689b90aafe17bb5907087fff4e42ba6f0143ff3fab93dfba
# 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...
af2ba7122ffbffec24826a4ec9b6c789acc4ea7a22c7ceb296b0b37ecc74dc16
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .core import *
c0d3dcfbef99d6da9ed0e59dac27386a24467eb5f4256552b9d00d83ee24e93f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module's main purpose is to act as a script to create new versions of ufunc.c when ERFA is updated (or this generator is enhanced). `Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this module/script to function. Note that this does *no...
ae6d6c529759da0100913099fe3f50a78dd36fa37520c7ae9c6a3aa98da883e1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import glob from distutils import log from distutils.extension import Extension from astropy_helpers import setup_helpers from astropy_helpers.utils import import_file from astropy_helpers.version_helpers import get_pkg_version_module ERFAPKG...
651dce58844a471398bd900356a07d55dc87d939b6ed885891d80fa338aaae98
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ .. _wcslib: http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/index.html .. _distortion paper: http://www.atnf.csiro.au/people/mcalabre/WCS/dcs_20040422.pdf .. _SIP: http://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/shupeADASS.pdf .. _FITS...
c162e6066e847615be86e24f3cc51005223d25c93523ec1d731e366a15e2953a
# Licensed under a 3-clause BSD style license - see LICENSE.rst CONTACT = "Michael Droettboom" EMAIL = "mdroe@stsci.edu" import io from os.path import join import os.path import shutil import sys from distutils.core import Extension from distutils.dep_util import newer_group from astropy_helpers.utils import impor...
848b8a09016c301efe5dc9247014e99b9a8553279632e5fdec50c0dc34d4446f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy import units as u from .wcs import WCS, WCSSUB_LONGITUDE, WCSSUB_LATITUDE, WCSSUB_CELESTIAL __doctest_skip__ = ['wcs_to_celestial_frame', 'celestial_frame_to_wcs'] __all__ = ['add_stokes_axis_to_wcs', 'celestial_frame_t...
19af0e7595a81c662b20b91a3c50c8d7fd9c3366e59cb30d4d98ec81d62b3da0
# 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 distortion, b...
5790a69ca9ee34fd87c59101d81d137426d199f2bd6b6cbed101fdb54e35a7a2
# 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 ...
892f120d5c5186ecee6a40286dc61c2edcf24be66d34b2972f1607b9139ff979
# -*- 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...
5efc8877f29a6f5ac8815eef12a85c6e14828f06c43ddec7126a955053da251a
# -*- 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...
086fe5c3da622bbaf74a81d55bf2f4ff184fb96bd1d75861e66482ac914dde26
# -*- 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 collections import OrderedDict, defaultdict import numpy as np from astropy.utils.decorators import lazyproperty from astropy.utils.exceptions import Astro...
46a663cdafb6a061a2965f5a6163d871bed3be6e4e46c909ccc61ee3325a9b0f
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['quantity_input'] import inspect from astropy.utils.decorators import wraps from astropy.utils.misc import isiterable from .core import Unit, UnitsError, add_enabled_equivalencies from .physical import _unit_physical_m...
d72589f2ce406b08ea9fc34ad6bb678ff8c4beffd999e50e8a0a1b845bb2a310
# -*- 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://cds.u-strasbg.fr/doc/ca...
770c5976a6397ad1581d44732886df784981bfd49f893def2f1f216787e372d8
# -*- 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`). """ ...
452949ebd115c25780746dfcfc3e553f618eb928ede6195492f57a2703f0315c
# -*- coding: utf-8 -*- # 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 fr...
3ff609890b7da031588006f73180498236a1e9694f93e0540b21ca642bee2116
# 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...
2baa9af0522fc5d8e7b4f6d4fc65da5c6f11519ac28f9624f6a6b361720c73b2
# -*- 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,...
c81ae5c11b1b65c93183b0749b2c7b30d7b236f01b378f4deed07dfad77cd736
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Defines physical unit names. This module is not intended for use by user code directly. Instead, the physical unit name of a `Unit` can be obtained using its `ptype` property. """ from . import core from . import si from . ...
7001ed0c5e0368d00525ede68ff523d3f5fa9c0eec674e764e2c5eb9ddeca43a
# 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 numbers import io import re from fractions import Fraction import numpy as np from numpy import finfo _float_fi...
41a0892ce50a32ce0cc6ff530616921594a75cf2f48c43fe4cd5f15c0ee45f1c
# -*- 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...
94fb4b2b1c17694b8ac4c2afcafad551bda002ea76aba5e349a02b5431179522
# -*- 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() ##...
7ab4b1ed2cda7ce8f24b0529f765799a91f51b9a6252e2b547d71dc78f4b0909
# 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.misc import isiterable from . import si from . impor...
442857c830c9113ee0d8af5843c1915129852d0ff4079af590135f953e0338ba
# 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 from collections import OrderedDict import numpy as np from .sky_coordinate import SkyCoord from astropy.utils.da...
7ca6bcf4ff30df6dff4dc2051831762f61918fad67daf253401d2153395a7459
# -*- 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'...
51c21149a3c26adb758bc7d26d017c107cf78a8a9608422ec860698c9e357c8e
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains utililies used for constructing rotation matrices. """ from functools import reduce import numpy as np from astropy import units as u from .angles import Angle def matrix_product(*matrices): """Matri...
5ff3ca2b94deb41fef9294e0e9c0cfe67d90531a313d42d25c87b6d17b8f9e92
# 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 ....
a70c2ff0e5387b4514bf3de06991af9572ec3d588fd1569f4b92d403bf10711c
# 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 __all__ = ['match_coordinates_3d', 'match_coordinates...
7664080e69fe2cd106f20d16b723f558fa0603cdf2a794825f19e89b19b02f50
import re import copy import numpy as np from astropy import _erfa as 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.wcs.utils import skycoord_to_pixel, pixel_to_skycoord from astropy.utils.data_info import Mixi...
0ae5e38c89d19b9707fb27181bce213c495aefe5b42ca6bfc21a9282f5a0e66b
""" 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 from collections import OrderedDict import inspect import warnings import numpy as np import astropy.uni...
476011c15f7e5e417343eb87056e63768b97cda0f4368042664e7355e2d30014
# 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...