hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
bded93adc301a0fcc3dd01dc4f3e259ca71231cc421fd7bee8443d206b1ce143 | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# NOTE: The configuration for the package, including the name, version, and
# other information are set in the setup.cfg file.
import sys
# First provide helpful messages if contributors try and run legacy commands
# for tests or d... |
38130b17f976bb6e9362cab7c0b3b3194c6644a357928a4401fd5a46c34d13c7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file is the main file used when running tests with pytest directly,
# in particular if running e.g. ``pytest docs/``.
import os
import tempfile
import hypothesis
from astropy import __version__
try:
from pytest_astropy_header.display import... |
849d26898fd469a494890a464c47e1076f6d55df28b54c2619cc895ab57340d1 | # NOTE: First try _dev.scm_version if it exists and setuptools_scm is installed
# This file is not included in astropy wheels/tarballs, so otherwise it will
# fall back on the generated _version module.
try:
try:
from ._dev.scm_version import version
except ImportError:
from ._version import ver... |
f3a0aeb97076b413c5b12bf54c9d21687bfae4f546d809811d8fd5110a7aa5eb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
"""
import os
... |
e3970894c3f13086681508803f5f44c92c2fd9b69c5f237606b04099de0ac0dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains pytest configuration settings that are astropy-specific
(i.e. those that would not necessarily be shared by affiliated packages
making use of astropy's test runner).
"""
import builtins
import os
import sys
import tempfile
import wa... |
ab94da6ed51f8e247cb5bf4f29bd54aa85a12e98494aebf149298826f5daa769 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module defines a logging class based on the built-in logging module.
.. note::
This module is meant for internal ``astropy`` usage. For use in other
packages, we recommend implementing your own logger instead.
"""
import inspect
import ... |
6f600f3b21fec07e8bd0aecdf780f73a4b028ba7cacacb37ef41fecbcb1b874f | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... |
b083f49c5a623cf28e75b25cd79688276dbe7ed19355a301169da9235586360e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file needs to be included here to make sure commands such
# as ``pytest docs/...`` works, since this
# will ignore the conftest.py file at the root of the repository
# and the one in astropy/conftest.py
import os
import tempfile
import pytest
# M... |
73b018608b35beb850df948ebe0315cbe4f8019618c62ccea33612d1f828bdf7 | import os
import shutil
import sys
import erfa # noqa
import pytest
import astropy # noqa
if len(sys.argv) == 3 and sys.argv[1] == '--astropy-root':
ROOT = sys.argv[2]
else:
# Make sure we don't allow any arguments to be passed - some tests call
# sys.executable which becomes this script when producing... |
bfa48512aada02006c25f249d8b46593f5a541cd7244d7f675f740dab06a9099 | # -*- coding: utf-8 -*-
"""
========================
Title of Example
========================
This example <verb> <active tense> <does something>.
The example uses <packages> to <do something> and <other package> to <do other
thing>. Include links to referenced packages like this: `astropy.io.fits` to
show the astro... |
9035692fe1ca2a75b94864183c99f6dfb14e7c446c8fa7bdbb53ec46b965569a | # -*- coding: utf-8 -*-
"""
========================================================================
Transforming positions and velocities to and from a Galactocentric frame
========================================================================
This document shows a few examples of how to use and customize the
`~ast... |
12bef7dc219d41692d2cbc9fe75a49900ea1f0df6e831e5d70e413d075a0fb12 | # -*- coding: utf-8 -*-
"""
===================================================================
Determining and plotting the altitude/azimuth of a celestial object
===================================================================
This example demonstrates coordinate transformations and the creation of
visibility cur... |
169d08766b27d0e8c3edf0512170a6796246d917db295c0b3463aa7bfb1c4330 | # -*- coding: utf-8 -*-
"""
================================================================
Convert a radial velocity to the Galactic Standard of Rest (GSR)
================================================================
Radial or line-of-sight velocities of sources are often reported in a
Heliocentric or Solar-syst... |
547790e0143fe9a8b1996e4cecd461eb313bd82630ddb4630845753fd1343eef | # -*- coding: utf-8 -*-
r"""
==========================================================
Create a new coordinate class (for the Sagittarius stream)
==========================================================
This document describes in detail how to subclass and define a custom spherical
coordinate frame, as discussed in... |
f060aa9837a0df597dbb32aa17d9db8fda514facc6f269012d3fc9611751b903 | # -*- coding: utf-8 -*-
"""
=====================================================
Create a multi-extension FITS (MEF) file from scratch
=====================================================
This example demonstrates how to create a multi-extension FITS (MEF)
file from scratch using `astropy.io.fits`.
*By: Erik Bray*... |
fbb510c5e0186d5e16961c613d3831dbd37a4d215fe262121af70c4b3d053210 | # -*- coding: utf-8 -*-
"""
==================
Edit a FITS header
==================
This example describes how to edit a value in a FITS header
using `astropy.io.fits`.
*By: Adrian Price-Whelan*
*License: BSD*
"""
from astropy.io import fits
#####################################################################... |
78cf5c60f74125abbfa26c0a951f75863b38c484d06ca630714937cedada6e19 | # -*- coding: utf-8 -*-
"""
=======================================
Read and plot an image from a FITS file
=======================================
This example opens an image stored in a FITS file and displays it to the screen.
This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open
th... |
042abe04a704fa7bcd949b1e95727d07e411096873c00d61d30b3d539d20354a | # -*- coding: utf-8 -*-
"""
==========================================
Create a very large FITS file from scratch
==========================================
This example demonstrates how to create a large file (larger than will fit in
memory) from scratch using `astropy.io.fits`.
*By: Erik Bray*
*License: BSD*
"""... |
f8e82631004deaaab5e0800e207f27d16652fb1494aaeb6bec42c040fe4f5c35 | # -*- coding: utf-8 -*-
"""
=====================================================================
Accessing data stored as a table in a multi-extension FITS (MEF) file
=====================================================================
FITS files can often contain large amount of multi-dimensional data and
tables. T... |
93f258becc4ec5da3768b6fd02d801854a4cb29f419856cfe08914b80cd312c8 | # -*- coding: utf-8 -*-
"""
=====================================================
Convert a 3-color image (JPG) to separate FITS images
=====================================================
This example opens an RGB JPEG image and writes out each channel as a separate
FITS (image) file.
This example uses `pillow <htt... |
dfc13bac93535762aa3d6012610dcf92120ad2d6ce7bf1a42700d457bad21447 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from numpy.core.multiarray import normalize_axis_index
from astropy.units import Quantity
from astropy.utils import isiterable
from astropy.utils.exceptions import AstropyUserWarning
from astropy.stats._fast_sigma_clip... |
bc8d3a39057c8b8bd873134b92c3d48b38660d331937e2def02f2dab1d513a3a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Bayesian Blocks for Time Series Analysis
========================================
Dynamic programming algorithm for solving a piecewise-constant model for
various datasets. This is based on the algorithm presented in Scargle
et al 2013 [1]_. This cod... |
09bbd38e466a98790d27444affa79c3418a6b8c8e451798b40883aaf1b3a2387 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains statistical tools provided for or used by Astropy.
While the `scipy.stats` package contains a wide range of statistical
tools, it is a general-purpose package, and is missing some that are
particularly useful to astronomy or a... |
40748fb8d5335457054df1a2845f23b17e313e59b9ad495a0578faeb965ea7bd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from setuptools import Extension
import numpy
SRCDIR = os.path.join(os.path.relpath(os.path.dirname(__file__)), 'src')
SRCFILES = ['wirth_select.c', 'compute_bounds.c', 'fast_sigma_clip.c']
SRCFILES = [os.path.join(SRCDIR, srcfile) for srcfi... |
fbd3884fc3b873a9a2ba6e586358f76e01bf28198212fe4a8a8cd36b64128bf5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple functions for dealing with circular statistics, for
instance, mean, variance, standard deviation, correlation coefficient, and so
on. This module also cover tests of uniformity, e.g., the Rayleigh and V tests.
The Maximum L... |
4a1d1cd842a3cbf45b3dc88ef31a3eecd1b675adfabc18e1097218cf00a7750d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements functions and classes for spatial statistics.
"""
import numpy as np
import math
__all__ = ['RipleysKEstimator']
class RipleysKEstimator:
"""
Estimators for Ripley's K function for two-dimensional spatial data.
... |
b3d62a5e1cea6aa287da76cab039739becf11914fa630a63874ca745a62c0355 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple statistical algorithms that are
straightforwardly implemented as a single python function (or family of
functions).
This module should generally not be used directly. Everything in
`__all__` is imported into `astropy.stats... |
0c2df0e5560a15ac227de6205a97591834239d839a67df4f818fb8e6701363a7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple functions for model selection.
"""
import numpy as np
__all__ = ['bayesian_info_criterion', 'bayesian_info_criterion_lsq',
'akaike_info_criterion', 'akaike_info_criterion_lsq']
__doctest_requires__ = {'bayesia... |
d2a3de647d8a8bd5580a17bbf673074333e74c6744949cbacf63fbe6a9e53372 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for computing robust statistics using
Tukey's biweight function.
"""
import numpy as np
from .funcs import _expand_dims, median_absolute_deviation
__all__ = ['biweight_location', 'biweight_scale', 'biweight_midvariance... |
6cb82580a2881915b30ac59e24eb082e0240d18ef503ae4495f3c5694e623719 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Methods for selecting the bin width of histograms
Ported from the astroML project: https://www.astroml.org/
"""
import numpy as np
from . import bayesian_blocks
__all__ = ['histogram', 'scott_bin_width', 'freedman_bin_width',
'knuth_bin_... |
81b632ee3068c5783fd5ea3c9246c9dc844ff16632bd960cecf39c3a36f6b936 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
__all__ = ['jackknife_resampling', 'jackknife_stats']
__doctest_requires__ = {'jackknife_stats': ['scipy']}
def jackknife_resampling(data):
"""Performs jackknife resampling on numpy arrays.
Jackknife resampling is a techniqu... |
4b83259e6207d52d8d9b693d36812f8c57b56e520ae8e00263d32e7baa712a94 | """
Table property for providing information about table.
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import os
from contextlib import contextmanager
from inspect import isclass
import numpy as np
from astropy.utils.data_info import DataInfo
__all__ = ['table_info', 'TableInfo', 'se... |
063b408848582eabfe45f09a87c6613ed8319d53254aabea0b6810bce4266a4c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... |
40c5ce95c5fb602e61894827ea7fc4bc730178129daa2acda4e156eb7e99bb33 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from os.path import abspath, dirname, join
from .table import Table
import astropy.io.registry as io_registry
import astropy.config as _config
from astropy import extern
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `as... |
632176446a2d126e44536efde415c8afe681d88ecb99aab614a2142a5ebb5b60 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.io import registry
from .info import serialize_method_as
__all__ = ['TableRead', 'TableWrite']
__doctest_skip__ = ['TableRead', 'TableWrite']
class TableRead(registry.UnifiedReadWrite):
"""Read and parse a data table and return as a T... |
8fbc137607dd786544e5b6eb12cd9c5af4315a5e24d3c71e1b17423a1110cc47 | # 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... |
06ad00fec8dcd0f8cfe753f63ff3657bf6074ec8911b60743ea075d8b3f2a0ca | # 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... |
c42c0d5375112980d71b0cd6ee7070da392b7dabf5ff04f8a182d7475032a61b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .index import SlicedIndex, TableIndices, TableLoc, TableILoc, TableLocIndices
import sys
from collections import OrderedDict, defaultdict
from collections.abc import Mapping
import warnings
from copy import deepcopy
import types
import itertools
impo... |
9f55f5b6c001ac7b387648d082eaf005e29735058b770c5ccbea1720f1fb5642 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import astropy.config as _config
from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo
__all__ = ['BST', 'Column', 'ColumnGroups', 'ColumnInfo', 'Conf',
'JSViewer', 'MaskedColumn', 'NdarrayMixin', 'QTable', 'Row',
... |
ef336ec0932a28b8b9b88157706988ce3b213d6c365c2299e9bf4a64a0ef5be7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import warnings
import weakref
from copy import deepcopy
import numpy as np
from numpy import ma
from astropy.units import Unit, Quantity
from astropy.utils.console import color_print
from astropy.utils.metadata import MetaData
from as... |
a7dc76058f28227b71b261fbb2ed79e521f40d68fe418394cacafc67740247d8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
__all__ = ['BST']
class MaxValue:
'''
Represents an infinite value for purposes
of tuple comparison.
'''
def __gt__(self, other):
return True
def __ge__(self, other):
return True
def __lt__(... |
01500c44fbe1b840b5994b9590d7d938abcd8d814e5cddacd971e7b2d1a1f3db | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import re
import fnmatch
import numpy as np
from astropy import log
from astropy.utils.console import Getch, color_print, terminal_size, conf
from astropy.utils.data_info import dtype_info_name
__all__ = []
def default_format_fun... |
ab5e01a4fb8d8a279059c81db4a7b0a1576ef1e408f5507c38e6f8f05008a664 | """
High-level table operations:
- join()
- setdiff()
- hstack()
- vstack()
- dstack()
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import collections
import itertools
from collections import OrderedDict, Counter
from collections.abc import Mapping, Sequence
import nu... |
f1ee16e162b20815876d2bc1e600a2b4c85cb8b2b7dc527b91caf1979ac11af1 | """
High-level operations for numpy structured arrays.
Some code and inspiration taken from numpy.lib.recfunctions.join_by().
Redistribution license restrictions apply.
"""
import collections
from collections import OrderedDict, Counter
from collections.abc import Sequence
import numpy as np
__all__ = ['TableMergeE... |
db6cde48d019a7516a096527dfad4880ddfce737eed00ed463371a967d1e3290 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from setuptools import Extension
import numpy
ROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = ["_np_utils.pyx", "_column_mixins.pyx"]
include_dirs = [numpy.get_include()]
exts = [
Extens... |
0edf849fcdd5a25cd472ccc4709c3def8dce4f5d16be9e1c20e54ec0c3fd805a | import json
import textwrap
import copy
from collections import OrderedDict
import numpy as np
import yaml
__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 c... |
2a7110f80c98f5adf82ba5a6956cf2039621dea290b84866126f7edc9f35c40e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
def _searchsorted(array, val, side='left'):
'''
Call np.searchsorted or use a custom binary
search if necessary.
'''
if hasattr(array, 'searchsorted'):
return array.searchsorted(val, side=side)
# Python ... |
96256403fa381e0dcf27947de86da85a4bd9ba0b09218f5e935f8f308e8c00bd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from importlib import import_module
import re
from copy import deepcopy
from collections import OrderedDict
import numpy as np
from astropy.utils.data_info import MixinInfo
from .column import Column, MaskedColumn
from .table import Table, QTable, has_in... |
74d945b8e25af2d5a74510c2585b7ad8c67bb880a8881cf09cb305eec7e60ff8 | # -*- coding: utf-8 -*-
ascii_coded = ('Ò♙♙♙♙♙♙♙♙♌♐♐♌♙♙♙♙♙♙♌♌♙♙Ò♙♙♙♙♙♙♙♘♐♐♐♈♙♙♙♙♙♌♐♐♐♔Ò♙♙♌♈♙♙♌♐♈♈♙♙♙♙♙♙♙♙♈♐♐♙Ò♙♐♙♙♙♐♐♙♙♙'
'♙♙♙♙♙♙♙♙♙♙♙♙Ò♐♔♙♙♘♐♐♙♙♌♐♐♔♙♙♌♌♌♙♙♙♌Ò♐♐♙♙♘♐♐♌♙♈♐♈♙♙♙♈♐♐♙♙♘♔Ò♐♐♌♙♘♐♐♐♌♌♙♙♌♌♌♙♈♈♙♌♐'
'♐Ò♘♐♐♐♌♐♐♐♐♐♐♌♙♈♙♌♐♐♐♐♐♔Ò♘♐♐♐♐♐♐♐♐♐♐♐♐♈♈♐♐♐♐♐♐♙Ò♙♘♐♐♐♐♈♐♐♐♐♐♐♙♙♐♐♐♐♐♙♙Ò♙♙♙♈♈♈♙♙♐'
... |
c7a43c550ca093c289825e09947505b08851e8ed59f33d5e4b4baa243433acc7 | # 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... |
3803d4f018c9f128ab44a84800013570dd6f86430357447cbe49546064f5766e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The SCEngine class uses the ``sortedcontainers`` package to implement an
Index engine for Tables.
"""
from collections import OrderedDict
from itertools import starmap
from astropy.utils.compat.optional_deps import HAS_SORTEDCONTAINERS
if HAS_SORTED... |
682e3d8156b7564494d9716af5da937fdb12074a6c1a7a91053209788ed2b994 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.utils.data_info import ParentDtypeInfo
class NdarrayMixinInfo(ParentDtypeInfo):
_represent_as_dict_primary_data = 'data'
def _represent_as_dict(self):
"""Represent Column as a dict that can be serialized... |
bb3a1d5060a3ff11882fcb64bfcb2ffc30c582bf7acef0c413a695b2f26886c4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import numpy as np
from astropy.modeling import models
from astropy.modeling.core import Fittable1DModel, Fittable2DModel
from astropy.utils.decorators import deprecated
from .core import Kernel, Kernel1D, Kernel2D
from .utils import Kernel... |
c169b389cf567fdfb734c0d9e7996b62eef67e6e6afc2671a8bcbe4d7f1c5134 | # 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... |
ecda11a531f97c021445f7caedb217964c658e8037c2f2315026505046833d26 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .convolve import (convolve, convolve_fft, convolve_models,
convolve_models_fft, interpolate_replace_nans)
from .core import *
from .kernels import *
from .kernels import MexicanHat1DKernel, MexicanHat2DKernel # Deprecated ker... |
4f343f23058dc3e840031492f54e1a195e40f2107527243a03304b4175ec108e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
from setuptools import Extension
import numpy
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_ar... |
17726359557846a9bc285294a7b63453a7a92b7213ff381ea2c89fe9b000744e | # 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', 'KernelSizeError']
class DiscretizationError(Exception):
"""
Called when discretization of models goes wrong.
"""... |
ad77159859fcbbd1117e643d270cc9a4d805e88c60bc461208a00c7620d33e63 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import ctypes
import os
import warnings
from functools import partial
import numpy as np
from numpy.ctypeslib import load_library, ndpointer
from astropy import units as u
from astropy.modeling.convolution import Convolution
from astropy.modeling.core i... |
20b60272a89c86924e46de801ee814347866d77118b3895b57e692ff92f284c4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains configuration and setup utilities for the
Astropy project. This includes all functionality related to the
affiliated package index.
"""
from .paths import *
from .configuration import *
from .affiliated import *
|
8d985199515e02e6e2f400c162a9db1a28a38141101a08cebd7c16fa5ff6bfe0 | # 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... |
8bf4abe46121188d939158adccea14afa50aab22c5370d1d97fde6081caea281 | # 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... |
61c457aac7921f6bc626391214e3718a070d8bd5742e8d0f6b0160a2b5a11f7e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module contains functions and classes for finding information about
affiliated packages and installing them.
"""
__all__ = []
|
0002370a62a344c79c835fbaa5f03fdb563af7d571be9a74a35c87370b3ae238 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Distribution class and associated machinery.
"""
import builtins
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 ... |
c42dd216e1a0c69e490d61fb1b09076b19404c9c809f8f2594a05375328d6013 | # -*- 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=... |
326a2c41c6da21e1d0352cef4a889f332c24215e9bcc8355d84fc5234b9733e1 | # -*- 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 propagate
uncertainties.
"""
from .core import *
from .distributions import *... |
888d3afe6e2163ca0358471c4f37d2c3a445eb2336a61ba3440d12ed34d6e4d1 | # 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... |
e66c5c40664fb019d58b6bb243b4abf6008929498af2300c8ea6f353835cd61c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
"""
This module defines classes that deal with parameters.
It is unlikely users will need to work with these classes directly,
unless they define their own models.
"""
import functools
import numbers
import operator
impo... |
13615f0d5a58344aa0054b03669f5badc519443b3578ecd78868f3fef9f7cb1e | # 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... |
3c033ea1ea18f10932c5afe71b5443b0e33743a29b69dfd3198f1cf45fb740d8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Convolution Model"""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import numpy as np
from .core import CompoundModel, SPECIAL_OPERATORS
class Convolution(CompoundModel):
"""
Wrapper class for a convolutio... |
b315ab814da85e99017acc9a5594a57cb806c1d89881ce08225151779bef328e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage provides a framework for representing models and
performing model evaluation and fitting. It supports 1D and 2D models
and fitting with parameter constraints. It has some predefined models
and fitting routines.
"""
from . import fitti... |
c86242b0670391cc346aa3926dc7a517a37762ac732bf2b99d306dfd8a2d77b0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Creates a common namespace for all pre-defined models.
"""
# pylint: disable=unused-wildcard-import, unused-import, wildcard-import
from .core import custom_model, hide_inverse, fix_inputs # pylint: disable=W0611
from .mappings import *
from .projec... |
dc4b0e635a696e8da1982942deec9dc1e477a036a86f81dc922c4593e4c9953f | """
Special models useful for complex compound models where control is needed over
which outputs from a source model are mapped to which inputs of a target model.
"""
# pylint: disable=invalid-name
from .core import FittableModel, Model
from astropy.units import Quantity
__all__ = ['Mapping', 'Identity', 'UnitsMappi... |
5743b99d4ac948817a5bb2262e7aff94a57e10110e870e644dd21879a9c191db | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Spline models and fitters."""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import warnings
import abc
import functools
import numpy as np
from astropy.utils.exceptions import (AstropyUserWarning,)
from astropy.ut... |
7e97bc9396f770b29eda8d721de127bf2375b382b72cb6e20106270bffbba0a3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
"""
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"]
# M... |
715e8ec2a6f31b9cfeb3ae29a2ff518c5dd13dcab3cc2f51413609de430ee682 | # 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... |
86dac592dc34e05fce53e0c958c7c1249c4d4204d65993cb4a9f8ad716cb3bfc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from os.path import join
from collections import defaultdict
from setuptools import Extension
from extension_helpers import import_file
# This defines the set of projection functions that we want to wrap.
# The key is the projection name, an... |
3c8495e56cdfd0aafb1dad58213fac5e4bcccf1db1006846263b7767842c267a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define Numpy Ufuncs as Models.
"""
import numpy as np
from astropy.modeling.core import Model
from astropy.utils.exceptions import AstropyUserWarning
trig_ufuncs = ["sin", "cos", "tan", "arcsin", "arccos", "arctan", "arctan2",
"hypot"... |
cac38fe9744203c720d50d6c88dcdcb0d93a7b2326fe89911e83640ad5676b0f | # 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_... |
0077f3fde0992659533832b99495fcec65076faaec6d720662421d4f259031b4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides utility functions for the models package.
"""
# pylint: disable=invalid-name
from collections import UserDict
from collections.abc import MutableMapping
from inspect import signature
import numpy as np
import warnings
from astro... |
7a1ea1d875c4c64951d1e16e7c47167f8c6f3c5c253c83e249bd95b389dcd9d3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module is to contain an improved bounding box
"""
import abc
import copy
from collections import namedtuple
from typing import Dict, List, Tuple, Callable, Any
from astropy.utils import isiterable
from astropy.units import Quantity
import wa... |
58c5581842a29d765307c0976dd589195ffc47b6af4532797a4357d2fe77b0d6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Mathematical models."""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import numpy as np
from astropy import units as u
from astropy.units import Quantity, UnitsError
from .core import (Fittable1DModel, Fittable2DMo... |
fa570dfec5214f7c109911af8ec37ae926a2cf3c7104a6374b3ce93ee75d3c56 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""
Implements projections--particularly sky projections defined in WCS Paper II
[1]_.
All angles are set and and displayed in degrees but internally computations are
performed in radians. All functio... |
332f7ac5e6eb1fff6a5d1f5dafa098593943e5579fcc6ffde5a23a62f9073ed9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains models representing polynomials and polynomial series.
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.utils import indent, check_broadcast
from .core import FittableModel, Model
from .functional_models import ... |
fbacca35c6e23fcd604c2a0e7df1f3bf1693bfd2a6a1dd84d847757755da1a9e | # 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.],
... ... |
0f72ef850070de7df590e1c309a56a398e6e4c1714a3299d64fdd06c5b7e533e | # 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 .c... |
5c9a89d66c31c31018f9af460a276471f4632bf93e50bae56ed3116a267f8b65 | # 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
from astropy.utils.decorators import format_doc
__all__ = ["leastsquare", "leastsquare_1d", "leastsquare_2d", "leastsquare_3d"]
def leas... |
936124836cd19c02fedf33b2199994e3cf63e1271c8c32118b8c082a600f15ec | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
# pylint: disable=invalid-name
import numpy as np
from astropy.units import Quantity
from .core import Fittable1DModel
from .parameters import Parameter, InputParameterError
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D', '... |
f13b74c859a84565f76eae729fb9305e0a7a38597c1c59479eaffe3611730865 | # 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... |
47a1ab834868aecbe78a8b223e77e7fffda6fc8c1b60c0c43bdcc9c1c4793711 | # 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... |
5eef71280f346091979e183d83e61ba38a80944c51fe2bc0e1677921169a78b3 | # 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... |
e3a1de16749eac98bddb4e6292abb23d3bb9fc0b7adad21b222cfae219d98b7f | # 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 SAMPWarn... |
0553dc69292ad6900890ef95c0711f1cda27ed774cd02d171732d1ae02ad0640 | # 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__ = []... |
bc905ed75f9cbaa0ea4d8941d412e595dd77d478311d5a71074a92df058ac676 | # 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... |
c3b5b78854348bc92fe963694ec5fff1975841f6fdd6e6a396114b54d0d2766c | # 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... |
612dac733ece31fd81ac7e6526337596616bd92277d7c20d082bf0a168689b95 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import traceback
import warnings
import socketserver
import xmlrpc.client as xmlrpc
from xmlrpc.server import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
from .constants import SAMP_ICON
from .errors import SAMPWarning
__all__ = []
clas... |
516410637a55041289464563427a02cbaaa17b9ac4eee7b9769d21643f68263c | # 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... |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | |
d4b2d908564f4283553e0acfe0aee4cd353942913916962cd668019019533108 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utility functions and classes
"""
import queue
import inspect
import traceback
from io import StringIO
import xmlrpc.client as xmlrpc
from urllib.request import urlopen
from .constants import SAMP_STATUS_ERROR
from .errors import SAMPProxyError
de... |
89a53222e00e9d3347d99c8ee5cbc65e130c496efc3fd77c78a488510f7e21a0 | # 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.3"
#: Gener... |
708d2d2c8983f1cecde9057ba246bf7f7ce13f5277063e72370f15ed2c0907f8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import xmlrpc.client as xmlrpc
from .errors import SAMPHubError
from .utils import ServerProxyPool
from .lockfile_helpers import get_main_running_hub
__all__ = ['SAMPHubProxy']
class SAMPHubProxy:
"""
Proxy class to simplify the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.