hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
5e282234101ff56e5e1a22a9023d6d7e5b702f31b8431fafd63c5c8b893fc905 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
from astropy.io import fits
from . import FitsTestCase
class TestDivisionFunctions(FitsTestCase):
"""Test code units that rely on correct integer division."""
def test_rec_from_string(self):
with fits.open(self.data('... |
f8b296713800bc23e4b05341fbe1a33abf1ac4c8402b312e7ad8f1096e044924 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import glob
import io
import os
import sys
import copy
import subprocess
import pytest
import numpy as np
from astropy.io.fits.hdu.base import _ValidHDU, _NonstandardHDU
from astropy.io.fits.verify import VerifyError, VerifyWarning
from astropy.io import... |
a1d4423cd9f4f189f236c66caee96b934da1c25e48e89519c7e97c44286c9e9a | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import collections
import warnings
from io import StringIO, BytesIO
import pytest
import numpy as np
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning, VerifyError
from astropy.utils.exceptions import AstropyUserWa... |
1f174301a1819e4356366cc5cd91f87d077dde497d3a12ae6b2617348651238e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
import functools
from contextlib import nullcontext
from io import BytesIO
import re
from textwrap import dedent
import pytest
import numpy as np
from numpy import ma
from astropy.table import Table, MaskedColumn
from astropy.io imp... |
45e0b57ce2d2ab35ebd215581d4b2c268fbc6b17ee72bd63adbbba34fba4c05b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``HTML``
reader/writer and aims to document its functionality.
Requires `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
to be installed.
"""
from io import StringIO
from astropy.... |
fba97372539a2b12d3c54a154bd3c1287fd58d764813042432242849df7ae3b6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``ECSV``
reader/writer.
"""
from astropy.table.column import MaskedColumn
import os
import copy
import sys
from io import StringIO
from contextlib import nullcontext
import pytest
import numpy as n... |
abc0d2a1de389e113d69239aa5ec4152c014e4242f2cb13aafd36cede9c166a1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.io.ascii.core import convert_numpy
import re
from io import BytesIO
from collections import OrderedDict
import locale
import platform
from io import StringIO
import pathlib
import pytest
import numpy as np
from astropy.io import ascii
from ... |
50c86a33f89156ca94e633de15ba99207d6226e5a8845385b828a68e74113a99 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import copy
from contextlib import nullcontext
from io import StringIO
from itertools import chain
import pathlib
import pytest
import numpy as np
from astropy.io import ascii
from astropy import table
from astropy.table.table_helpers import s... |
5c6eec5a823f06867621373625ed62d7c5e5c7c12409fbcf78c4e45aba0a830c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects ASDF to the astropy.table.Table class
import warnings
from astropy.io import registry as io_registry
from astropy.io.misc.asdf.deprecation import create_asdf_deprecation_warning
from astropy.table import Table
from astropy.utils.compa... |
96e047ee2294c32f08c5251eebb68f89ced89a503acb184914f704d04154e3c8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from asdf.types import CustomType, ExtensionTypeMeta
from astropy.io.misc.asdf.deprecation import create_asdf_deprecation_warning
__all__ = ['AstropyType', 'AstropyAsdfType']
# Names of AstropyType or AstropyAsdfType subclasses that are... |
51b1c0bc2598f1eb6b5c56c5df580b539d4d65d9e1340103e7639920e1686cad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from asdf.extension import AsdfExtension, BuiltinExtension
from asdf.util import filepath_to_url
# Make sure that all tag implementations are imported by the time we create
# the extension class so that _astropy_asdf_types is populated correct... |
a2dbf72c4589448a97042d9e62aec523e3b780a639941df932fb2b0955d2c398 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Define a constant to know if the entry points are installed, since this impacts
# whether we can run the tests.
from importlib.metadata import entry_points
import pytest
# TODO: Exclusively use select when Python minversion is 3.10
eps = entry_points... |
689594fd111347106d6e3ac575ec74c37def58b73f0e8cbcd46ae0f9faa347ef | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
from astropy.table import Table
def make_table():
a = [1, 4, 5]
b = [2.0, 5.0, 8.2]
c = ['x', 'y', 'z']
return Table([a, b, c], names=('a', 'b', 'c'), meta={'name': 'first table'})
de... |
3811925cf287c3eeb7881dea21569759ef5b31c254ab01114c7a8dc2c26a1e03 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates.tests.helper import skycoord_equal as _skycoord_equal
from astropy.utils.decorators import deprecated
__all__ = ['skycoord_equal']
@deprecated("5.1", alternative="astropy.coordinates.tests.helper.skycoord_equal")
def skycoord_e... |
a559311bd17121ecd678d7c205a62f52514db60fb499aba5010fed39f02113a3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from asdf.tags.core.ndarray import NDArrayType
from astropy import table
from astropy.io.misc.asdf.types import AstropyType, AstropyAsdfType
class TableType:
"""
This class defines to_tree and from_tree methods that are used ... |
681d4ebd2b88471ac0dfd4795d81c35f48645d47d2da32eb2a8596893eb64f4a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_array_equal
from astropy import table
from astropy.io import fits
from astropy.io.misc.asdf.types import AstropyType, AstropyAsdfType
class FitsType:
name = 'fits/fits'
types = ['astropy.io.fits.HDUList']
req... |
6206ea36f53706f163af0878ba6c88d7a5f006938a767381de1d876e8cb9d16d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from asdf.versioning import AsdfVersion
from astropy.modeling.bounding_box import ModelBoundingBox, CompoundBoundingBox
from astropy.modeling import mappings
from astropy.modeling import functional_models
from astropy.modeling.core imp... |
77e9c42d294ce53b94f443ef8271021e4a86d0a10ccf9c8ab0078cd5c4526215 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import astropy.units as u
def _parameter_to_value(param):
if param.unit is not None:
return u.Quantity(param)
else:
return param.value
|
d59d84d4a37fd8473d5193df3303444f118c04e6e4b49667c5baec57cc4ca995 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.modeling.math_functions import __all__ as math_classes
from astropy.modeling.math_functions import *
from astropy.modeling import math_functions
from astropy.io.misc.asdf.tags.transform.basic import TransformType
__all__ = ['NpUfuncType']
... |
a05646dd73f8ca921743d9cdccde0a3c64cd20d126bb4d3eb01a08858bdb0532 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_array_equal
from astropy.modeling import functional_models
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to_value
__all__ = ['AiryDisk2DType', 'Box1DType', 'Box2DType',
... |
71c5da54e55c037b69caed1c8d706649f0a9ffb30ef0c55902e3d9513e862a58 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_array_equal
from astropy import modeling
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to_value
__all__ = ['AffineType', 'Rotate2DType', 'Rotate3DType',
'Rotation... |
d37f83d26d2be072cb865d4bd160bd1631bf75da0f94dd6443158a60664658b2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_array_equal
from asdf.versioning import AsdfVersion
import astropy.units as u
from astropy import modeling
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to... |
2057e193917b4f4a97930285478ec3ddee440aa5633b02a35a8cffc4128da812 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_array_equal
from astropy import modeling
from astropy import units as u
from astropy.modeling.bounding_box import ModelBoundingBox
from astropy.io.misc.asdf.tags.transform.basic import TransformType
__a... |
f0a377abdd0b81d00129dee4b4afdb781dcd74c77f0154127ed495f15bd5ab8a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_array_equal
from astropy.modeling import physical_models
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to_value
__all__ = ['BlackBody', 'Drude1DType', 'Plummer1DType']
cla... |
9de26ec9fade65b8fab95555e1468f6b2968c54dc2eb3a1b8cdf9e8f7b60cbcd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from asdf import tagged
from asdf.tests.helpers import assert_tree_match
from astropy.modeling.core import Model, CompoundModel
from astropy.modeling.models import Identity, Mapping, Const1D
from astropy.io.misc.asdf.deprecation import cre... |
b3dfcb92a23d3ca6e6b105e85176372e0ace3d6d20e0c74032ad23627578d2d1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_array_equal
from astropy.modeling import powerlaws
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to_value
__all__ = ['PowerLaw1DType', 'BrokenPowerLaw1DType',
'Sm... |
c76cc2ee1ac07360cf1756fe90fb91731569c3915d34e28f53e5e7bdef39ec74 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import numpy as np
from astropy.time import TimeDelta
from astropy.io.misc.asdf.types import AstropyType
__all__ = ['TimeDeltaType']
allclose_jd = functools.partial(np.allclose, rtol=2. ** -52, atol=0)
allclose_jd2 = functools.partial(... |
60226f69f7a01488e07b5eda27e76e0ce4636d972e9a2e53a560f66943a4e084 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_array_equal
from asdf.versioning import AsdfSpec
from astropy import time
from astropy import units as u
from astropy.units import Quantity
from astropy.coordinates import EarthLocation
from astropy.io.... |
cb2e69ea73ab7109a83322afe3d232e53701244d391c1d9da58b0835032898cb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from asdf.tags.core import NDArrayType
from astropy.coordinates.spectral_coordinate import SpectralCoord
from astropy.io.misc.asdf.types import AstropyType
from astropy.io.misc.asdf.tags.unit.unit import UnitType
__all__ = ['SpectralCoordType']
class ... |
fa067dd31b23d43beef2f4b835970657c69c08ab321d0998d6703d79959595d5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import glob
import warnings
from asdf import tagged
import astropy.units as u
import astropy.coordinates
from astropy.coordinates.baseframe import frame_transform_graph
from astropy.units import Quantity
from astropy.coordinates import ICRS, Lo... |
12e4b0cda3778eb026462d1b075eff6fc2c96159e6ecf1e5ad3691a2005aa8b2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates import SkyCoord
from astropy.coordinates.tests.helper import skycoord_equal
from astropy.io.misc.asdf.types import AstropyType
class SkyCoordType(AstropyType):
name = 'coordinates/skycoord'
types = [SkyCoord]
version ... |
46da0e832a0d3f6bb0febde7af52df0c6f147c521e3aa1dca28e11896a936777 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates import Angle, Latitude, Longitude
from astropy.io.misc.asdf.tags.unit.quantity import QuantityType
__all__ = ['AngleType', 'LatitudeType', 'LongitudeType']
class AngleType(QuantityType):
name = "coordinates/angle"
type... |
7322fb61300b5316f94b8f15fdfd7a2bdbe4243e846314b14b4cee7a3a466938 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates import EarthLocation
from astropy.io.misc.asdf.types import AstropyType
class EarthLocationType(AstropyType):
name = 'coordinates/earthlocation'
types = [EarthLocation]
version = '1.0.0'
@classmethod
def to_t... |
7597eaf597b5134df065f880ceb2598b9d0d1ade1b9e1ad5f828aa9df38c9d12 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
def run_schema_example_test(organization, standard, name, version, check_func=None):
import asdf
from asdf.tests import helpers
from asdf.types import format_tag
from asdf.schema import load_schema
tag = format_ta... |
f930af65a584f75e2ba4e35c573d4a64e267bff37cb47bf1aa42d5a7938e6c60 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.units.equivalencies import Equivalency
from astropy.units import equivalencies
from astropy.io.misc.asdf.types import AstropyType
class EquivalencyType(AstropyType):
name = "units/equivalency"
types = [Equivalency]
version = '1.0... |
12ee8cefaac6b279a4d01c1a23fd67be323a173c0d6da2e8f85bbacfecca92d7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.units import Unit, UnitBase
from astropy.io.misc.asdf.types import AstropyAsdfType
class UnitType(AstropyAsdfType):
name = 'unit/unit'
types = ['astropy.units.UnitBase']
requires = ['astropy']
@classmethod
def to_tree(cl... |
c1efcdbddc7b38b22e259e5ad563d0063c0aff2c7c681f64fc352cfc2e1d51cc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from asdf.tags.core import NDArrayType
from astropy.units import Quantity
from astropy.io.misc.asdf.types import AstropyAsdfType
class QuantityType(AstropyAsdfType):
name = 'unit/quantity'
types = ['astropy.units.Quantity']
requires = ['astr... |
11451e058de7073973e2ffd16006353ebc6845f07d781a499d60ff234bbee9e2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import numpy as np
from packaging.version import Version
import astropy.units as u
from astropy import table
from astropy.time import Time, TimeDelta
from astropy.coordinates import SkyCoord, EarthLocati... |
02ae6f7db85b68e4710d11a9262f497a82a664c883f3114b076007ea2ee872af | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import os
import numpy as np
from astropy.io import fits
from asdf.tests import helpers
from astropy.io.misc.asdf.tags.tests.helpers import run_schema_example_test
def test_complex_structure(tmpdir)... |
c58dae81cda38da14675470931f75b012197d7c547457145913ee6277c693d63 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import warnings
from packaging.version import Version
import numpy as np
from asdf import util
from asdf.tests import helpers
from asdf import AsdfFile
import asdf
import astropy.units as u
from astrop... |
cb62d43ff524c73e9af973b8c9949f0f918a204a683d011bdd7f339c956d4119 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree
from astropy import units as u
from astropy.time import Time, TimeDelta
@pytest.mark.parametrize('fmt', TimeDelta.FORMATS.keys())
def test_timedelta(... |
924509b787abbb176d3dfd7708e2b5bbaed9d20b9e21ce216cab281043c26348 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import datetime
import numpy as np
from astropy import time
from asdf import AsdfFile, yamlutil, tagged
from asdf.tests import helpers
import asdf.schema as asdf_schema
def _flatten_combiners(schema)... |
34019a42407affffadbfad6804d11a3bf73d25d22eaf0ea2fd59887a9e4a88c7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree
from astropy import units
from astropy.coordinates import ICRS, FK5, Longitude, Latitude, Angle
from astropy.io.misc.asdf.extension import AstropyExte... |
1731cdb0d08f80e951e1ff7f3f33adfe079a6faebd56d03a420e07afd6e86e59 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree
from astropy import units as u
from astropy.coordinates.angles import Longitude, Latitude
from astropy.coordinates.earth import EarthLocation, ELLIPSOI... |
b8c801bd16b8942a3d1b45d361fd39407de3032a7304dde4033cf6694fa8490b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import SkyCoord, ICRS, Galactic, FK4, FK5, Longitude
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree
# These tests are cr... |
5d8094ee32d50c366a902f321856c0a085986be42aa72b39e59bcdcb76867b8a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import astropy.units as u
from asdf.tests.helpers import assert_roundtrip_tree
from astropy.coordinates import Longitude, Latitude, Angle
from astropy.io.misc.asdf.extension import AstropyExtension
d... |
0afa77475af09680bc10ca78c99988fdc45ccbd76e1dea79686e8d415ad68248 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
from numpy.random import random, randint
import astropy.units as u
from astropy.coordinates import Angle
import astropy.coordinates.representation as r
from asdf.tests.helpers import assert_roundtrip_tr... |
6d6c87fe2ba40592460837f8cd1ebbd93918e82344a9f8c7720ac35a90aed9fc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy import units as u
from astropy.coordinates import SpectralCoord, ICRS, Galactic
from astropy.tests.helper import assert_quantity_allclose
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree ... |
5a4658130fa9f7e483439b257eae715f6294051fbf311c8363be89800d614590 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import io
from astropy import units as u
from asdf.tests import helpers
# TODO: Implement defunit
def test_unit():
yaml = """
unit: !unit/unit-1.0.0 "2.1798721 10-18kg m2 s-2"
"""
buff ... |
41fa8f95905a33593f151763343107c2d1a0d9b536268bd92a99445b03af9183 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip('asdf')
import io
from astropy import units
from asdf.tests import helpers
def roundtrip_quantity(yaml, quantity):
buff = helpers.yaml_to_asdf(yaml)
with asdf.open(buff) as ff:
assert (ff.tree... |
d0e3705fc939a90e355fffe8bc92c9c20d127e332b5260a2ef4983df04ba8ddb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy import units as u
from astropy.units import equivalencies as eq
from astropy.cosmology import Planck15
asdf = pytest.importorskip('asdf', minversion='2.3.0.dev0')
from asdf.tests import helpers
def get_equivalencies():
"... |
ef79ba61ba1d3a949b2df96521c294109c158d4acf316f6072232547788909ef | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test :mod:`astropy.io.registry`.
.. todo::
Don't rely on Table for tests
"""
import contextlib
import os
from collections import Counter
from copy import copy, deepcopy
from io import StringIO
import pytest
import numpy as np
import astropy... |
2ad2713d225c25c77c8f13b0da0540b170f75d1e36734aafa51484bf556fe830 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a set of regression tests for vo.
"""
# STDLIB
import difflib
import io
import pathlib
import sys
import gzip
from unittest import mock
# THIRD-PARTY
import pytest
import numpy as np
from numpy.testing import assert_array_equal
# LOCAL
from ... |
87a8ec84bd3e5dbc5db1ae78dd3c57687b938484353e17ca43beb56f43aeea91 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the conversion to/from astropy.table
"""
import io
import os
import pathlib
import pytest
import numpy as np
from astropy.config import set_temp_config, reload_config
from astropy.utils.data import get_pkg_data_filename, get_pkg_data_fileobj
fro... |
7db14155486c626e0ba7da6602689a0783cf053a9321265ebf2f88082564b576 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains a class to handle a validation result for a single VOTable
file.
"""
# STDLIB
from xml.parsers.expat import ExpatError
import hashlib
import os
import shutil
import socket
import subprocess
import warnings
import pickle
import urllib.request... |
01531132e7ce6d6744bc260b9356f72f2490583432a7f6c69ca088af471c911f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
# test helper.run_tests function
from astropy import test as run_tests
# run_tests should raise ValueError when asked to run on a module it can't find
def test_module_not_found():
with pytest.raises(ValueError):
run_tests(packa... |
812294f75396e8cb4e789b4f0207b102756c26549f791857db7b94c208a09d51 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from datetime import datetime
import pytest
from numpy.testing import assert_equal, assert_allclose
from astropy.table import Table, Column
from astropy.time import Time, TimeDelta
from astropy import units as u
from astropy.units import Quantity
from ... |
f345aa9863d2bdfdc87b5482fc6332988bd0be42e1c25160e0f72186eb5a49b3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["bls_fast", "bls_slow"]
import numpy as np
from functools import partial
from ._impl import bls_impl
def bls_slow(t, y, ivar, period, duration, oversample, use_likelihood):
"""Compute the periodogram using a brute force reference method... |
d56ee42e607d87d79c4ba63660f75afec3355835827a0a0f62760ea842598ac5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"]
import numpy as np
from astropy import units
from astropy.time import Time, TimeDelta
from astropy.timeseries.periodograms.lombscargle.core import has_units, strip_units
from astropy import units a... |
eed96ab9e721e276da439ce2023495c30e23248a8c55649fd51405c0b55dfe9e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from astropy import units as u
from astropy.time import Time, TimeDelta
from astropy.tests.helper import assert_quantity_allclose
from astropy.timeseries.periodogram... |
32f9f9154089b15fba2df19ffc28b401f5974b38c2aa417bd5335c9d20e57945 | import numpy as np
from .mle import design_matrix
def lombscargle_chi2(t, y, dy, frequency, normalization='standard',
fit_mean=True, center_data=True, nterms=1):
"""Lomb-Scargle Periodogram
This implements a chi-squared-based periodogram, which is relatively slow
but useful for vali... |
b271b6da3bebaace3aa75c05ec3129e218071611c871ff6bdf60efcdd93869f8 | import numpy as np
from .utils import trig_sum
def lombscargle_fast(t, y, dy, f0, df, Nf,
center_data=True, fit_mean=True,
normalization='standard',
use_fft=True, trig_sum_kwds=None):
"""Fast Lomb-Scargle Periodogram
This implements the Press & R... |
1908c0c11903c366c8c110f51f857d83c6766cff5d2671318ed389d152381db3 | import numpy as np
def lombscargle_scipy(t, y, frequency, normalization='standard',
center_data=True):
"""Lomb-Scargle Periodogram
This is a wrapper of ``scipy.signal.lombscargle`` for computation of the
Lomb-Scargle periodogram. This is a relatively fast version of the naive
O[... |
809c2809386143c3abcbf69b5e936243741694c85044e41d1b682f0e95b9f926 | import numpy as np
def lombscargle_slow(t, y, dy, frequency, normalization='standard',
fit_mean=True, center_data=True):
"""Lomb-Scargle Periodogram
This is a pure-python implementation of the original Lomb-Scargle formalism
(e.g. [1]_, [2]_), with the addition of the floating mean (... |
3004860c342c73c3cca2eaa36e757f66f6b2cc3248cfb867b02726b194936ada | import numpy as np
from .utils import trig_sum
def lombscargle_fastchi2(t, y, dy, f0, df, Nf, normalization='standard',
fit_mean=True, center_data=True, nterms=1,
use_fft=True, trig_sum_kwds=None):
"""Lomb-Scargle Periodogram
This implements a fast chi-squar... |
15a4162c218338b6082cf1b4a6d28fa2616846822a4463e3a5233f1612a0853e | import numpy as np
def design_matrix(t, frequency, dy=None, bias=True, nterms=1):
"""Compute the Lomb-Scargle design matrix at the given frequency
This is the matrix X such that the periodic model at the given frequency
can be expressed :math:`\\hat{y} = X \\theta`.
Parameters
----------
t :... |
e1ffb979d82e2574dc004fe57772639c588ea7d753828bc10cb6ecdd1307aa0b | import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from astropy.timeseries.periodograms.lombscargle.implementations.utils import extirpolate, bitceil, trig_sum
@pytest.mark.parametrize('N', 2 ** np.arange(1, 12))
@pytest.mark.parametrize('offset', [-1, 0, 1])
def test_bitceil(N,... |
87ddd57f582333e396136b1b6ccb0db8cd86a6f141993f7f4eac0dd1bf1ba6e2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Comparison functions for `astropy.cosmology.Cosmology`.
This module is **NOT** public API. To use these functions, import them from
the top-level namespace -- :mod:`astropy.cosmology`.
This module will be moved.
"""
from __future__ import annotations... |
a2888b13f333ed5044381cd7b61cb6f913ef433a040d5b8a2fd22fba84e3a69d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for `astropy.cosmology`."""
from .comparison import cosmology_equal
# _z_at_scalar_value is imported for backards compat
from .optimize import _z_at_scalar_value, z_at_value # F401, F403
__all__ = ["z_at_value", "cosmology_equal"]
|
1ec9a8baf80ea6d672b064d0f7d695c01aea4f960b6ffbb5a392661ca42cc735 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Convenience functions for `astropy.cosmology`.
"""
import warnings
import numpy as np
from astropy.cosmology import units as cu
from astropy.cosmology.core import CosmologyError
from astropy.units import Quantity
from astropy.utils.exceptions import... |
66a43380f014143d4c61cf15e5b09850e3adcf281318dbf6bd379f9d2bb5e3b4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Read/Write/Interchange methods for `astropy.cosmology`. **NOT public API**.
"""
# Import to register with the I/O machinery
from . import cosmology, ecsv, mapping, model, row, table, yaml # noqa: F401, F403
|
1aa927e45493f98ffd2e8f5b943a963253b4e30119b01b17e7c26cbe8d779178 | """Testing :mod:`astropy.cosmology.units`."""
##############################################################################
# IMPORTS
import pytest
import astropy.cosmology.units as cu
import astropy.units as u
from astropy.cosmology import Planck13, default_cosmology
from astropy.tests.helper import assert_quantit... |
ff345764bedc36769f530f1108d9c5088a04b46d2c4fe0965ea9e7576ecb1036 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.core`."""
##############################################################################
# IMPORTS
# STDLIB
import abc
import inspect
import pickle
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
import astrop... |
24dd945ab80d8a31c813f4233265ad474afd49526f0b535448cb0952a4235e9f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import pickle
# THIRD PARTY
import pytest
# LOCAL
import astropy.cosmology.units as cu
import astropy.units as u
from astropy import cosmology
from astropy.cosmology import parameters, realizations
from astropy.cosmology.realizations import Pla... |
018eb4f855cd639bc1888745b53890219c6a40b91e3700db3cf6effccc5c8593 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import annotations
import warnings
from abc import abstractmethod
from math import exp, floor, log, pi, sqrt
from numbers import Number
from typing import Any, Mapping, TypeVar
import numpy as np
from numpy import inf, sin
import astrop... |
fd343b36e1c751e93ac147e9b461f2ec2b1107d1ca390acaf3a8a13247a5264e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for :mod:`astropy.cosmology.comparison`"""
import re
import numpy as np
import pytest
from astropy.cosmology import Cosmology, FlatCosmologyMixin, Planck18, cosmology_equal
from astropy.cosmology.connect import convert_registry
from astropy.co... |
52936d94e2f777d40fee84b3ba2d6cb5582e0261125c0b46f8ae894631df36aa | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import sys
from io import StringIO
import numpy as np
import pytest
from astropy import units as u
from astropy.cosmology import core, flrw
from astropy.cosmology.funcs import _z_at_scalar_value, z_at_value
from astropy.cosmology.realizat... |
5e3e3f1a4269b5b5969103f88a1cd876ab669cd922f080cf6b665519eb8fada7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import inspect
import random
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology.core import Cosmology
from astropy.cosmology.io.model import _CosmologyModel, from_model, to_model
from astropy.cosmology.tests.helper im... |
e83c27359a9cff5cef57ff45615c5a4d4a0927ef3318cb1494c4477f1512cb1b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import json
import os
# THIRD PARTY
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import units as cu
from astropy.cosmology.connect import readwrite_registry
from astropy.cosmology.core import Cosmology
from .base impo... |
a574b791639ce91442f83c61f1a4a97c42841512f7ed86256c1159080facacc2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.base`."""
##############################################################################
# IMPORTS
# STDLIB
import abc
import copy
# THIRD PARTY
import numpy as np
import pytest
import astropy.constants as const... |
1ec0b43042806ee1a0f18785d1c4d07723239face6a93b86e5488c19227f3285 | # 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... |
ac2d3923b11a7ef420e6c1de9da28f0186e9a0a40cb985e03eb593a46a9c808e | # 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... |
1739b93e5b2f1080edc21633f8b19015fc9e64b1e4e9ed533846a807ac4e2c0f | # Note that we test the main astropy.wcs.WCS class directly rather than testing
# the mix-in class on its own (since it's not functional without being used as
# a mix-in)
import warnings
from packaging.version import Version
import numpy as np
import pytest
from numpy.testing import assert_equal, assert_allclose
from... |
633e7be86a4c03acab794d3e1fc79eb1d3dd6b2d8a81e4d7c4939e0831bf08c2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import units as u
from astropy.utils.decorators import format_doc
from astropy.coordinates import representation as r
from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from astr... |
734813195f38c7fb08624145bf42806818dec113462bcd524f2cf9bae263b49d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import units as u
from astropy.utils.decorators import format_doc
from astropy.coordinates import representation as r
from astropy.coordinates.baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from astropy.coordinates.attr... |
35eb3244c46a81c539794b3cab839f3b049671dd5a89a05e4e8a947f29254800 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from contextlib import ExitStack
import pytest
import numpy as np
from numpy import testing as npt
from astropy import units as u
from astropy.time import Time
from astropy.tests.helper import assert_quantity_allclose as assert_allclose
from astropy.util... |
d53b59c42a40b47b3496359d744f581958eda4cf73a3f03c9ac642770c0701d5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``HTML``
reader/writer and aims to document its functionality.
Requires `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
to be installed.
"""
from io import StringIO
from astropy.... |
2c6696c691cd866479ac6eb9edddb8af3fbe8c7acbbb22d7f3cb08efa3189b31 | # 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... |
367f0a33efbe0a9cc040c8a07e9a134ddb1ce7085c6c5a145963c0058f26e039 | import difflib
import functools
import sys
import numbers
import numpy as np
from .misc import indent
__all__ = ['fixed_width_indent', 'diff_values', 'report_diff_values',
'where_not_allclose']
# Smaller default shift-width for indent
fixed_width_indent = functools.partial(indent, width=2)
def diff_va... |
2dc581d7257062bc2f22e683debcc13e5093078cf353b0d4baf54158c4791ee2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Time utilities.
In particular, routines to do basic arithmetic on numbers represented by two
doubles, using the procedure of Shewchuk, 1997, Discrete & Computational
Geometry 18(3):305-363 -- http://www.cs.berkeley.edu/~jrs/papers/robustr.pdf
Furtherm... |
f4c2620245313ca327b332d7e37d08bb864d87949863c8e83d386295213e5003 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Core units classes and functions
"""
import inspect
import operator
import textwrap
import warnings
import numpy as np
from astropy.utils.decorators import lazyproperty
from astropy.utils.exceptions import AstropyWarning
from astropy.utils.misc im... |
af18797ee2348ae8e489114f96680e652ebd1cdbfe04a46c7471e8091a9532a8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the fundamental classes used for representing
coordinates in astropy.
"""
import warnings
from collections import namedtuple
import numpy as np
from . import angle_formats as form
from astropy import units as u
from astropy.uti... |
b0e7d3d4dd5b56d027e8aa18b048fdd82fd2a16738d3f8b4d5ba3ac467267c0b | # 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',
'... |
6c60f617d68d59a5c00e98827b1a706081322d51dbe055fe6b1a0f354c1142fe | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Cosmological units and equivalencies.
""" # (newline needed for unit summary)
import astropy.units as u
from astropy.units.utils import generate_unit_summary as _generate_unit_summary
__all__ = ["littleh", "redshift",
# redshift equivalen... |
2764faad1fc7d0c3f1d309d6ca726297bae1aedbe5264594b16c24d962e45785 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from astropy.visualization.mpl_normalize import simple_norm
from astropy import log
from astropy.io.fits import getdata
__all__ = ['fits2bitmap', 'main']
def fits2bitmap(filename, ext=0, out_fn=None, stretch='linear',
power=1... |
8973b67dc462cb0e8bb8ff1bd8126eedbf428d232d2e906269c9d6f7014ad091 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent
import numpy as np
import astropy.units as u
from astropy.coordinates import FK5, SkyCoord
from astropy.time import Time
from astropy.visualization.wcsaxes.core import WCSAxes
... |
6c97eea834c927338d9976a02a7300f1d04ecf9987261e4180e1e2a877eb05ee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import copy
import functools
import datetime
from copy import deepcopy
from decimal import Decimal, localcontext
from io import StringIO
import numpy as np
import pytest
from numpy.testing import assert_allclose
import erfa
from erfa import Erf... |
1074294d3634d51f50dd35ce20c6c514c36de4ca434944819b4bef22807b18ce | import decimal
import warnings
import functools
import contextlib
from decimal import Decimal
from datetime import datetime, timedelta
import pytest
from hypothesis import assume, example, given, target
from hypothesis.extra.numpy import array_shapes, arrays
from hypothesis.strategies import (composite, datetimes, flo... |
76bf47115989e59ded51c87331046f7e1fa703f4debae4568916f2a9782effaf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains the transformation functions for getting to/from ITRS, TEME, GCRS, and CIRS.
These are distinct from the ICRS and AltAz functions because they are just
rotations without aberration corrections or offsets.
"""
import numpy as np
import erfa
f... |
92df141d882084b5ff657d5f580f3036f76e6b86624271a567952867dec9511f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains the coordinate frames implemented by astropy.
Users shouldn't use this module directly, but rather import from the
`astropy.coordinates` module. While it is likely to exist for the long-term,
the existence of this package and de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.