hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
68fc557d042fb272459d4f7f0b4be74f3dc1f6bedb9de3d27809a71762fe8dde | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import units as u
from astropy.coordinates import BaseCoordinateFrame
__all__ = [
"select_step_degree",
"select_step_hour",
"select_step_scalar",
"transform_contour_set_inplace",
]
def select_step_degre... |
021befb5706ca75a7e6c73e91b07b33de9f318956a47f600636661afb93fcac0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy import units as u
# Algorithm inspired by PGSBOX from WCSLIB by M. Calabretta
LONLAT = {"longitude", "latitude"}
def wrap_180(values):
values_new = values % 360.0
with np.errstate(invalid="ign... |
aab15529825f6b9786d2b8f762a70cc6ef4e3f90c3f9a8c58f6650b2f04424af | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
from collections import OrderedDict
import numpy as np
from matplotlib import rcParams
from matplotlib.lines import Line2D, Path
from matplotlib.patches import PathPatch
__all__ = [
"RectangularFrame1D",
"Spine",
"BaseFrame",
... |
8ff89f49e94a50f9a9c7be93a1d6e3eb12297517ce04d4531e1d0a981de18d50 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from matplotlib.lines import Path
from astropy.coordinates.angle_utilities import angular_separation
# Tolerance for WCS round-tripping, relative to the scale size
ROUND_TRIP_RTOL = 1.0
# Tolerance for discontinuities relative to th... |
81c0ad57cfbb975a221aada1cade6a5e59c62b61342fda65d1ec08df376136a5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from contextlib import nullcontext
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
from matplotlib.contour import QuadContourSet
from packaging.version import Version
from astropy import units as u
from ... |
84c5d94706ecf6a921a502ed919d0a67f868af5f458eadfd652bcf8f65bfc511 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from astropy.tests.figures import figure_test
from astropy.visualization.wcsaxes import WCSAxes
from astropy.visualization.wcsaxes.transforms import CurvedTransform
from a... |
d4b4650f5e5cf18ac24f47cb448a74fab2c6441c7d77188552ac16993de0aacc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from textwrap import dedent
import matplotlib.pyplot as plt
import numpy as np
import pytest
from matplotlib.transforms import Affine2D, IdentityTransform
from astropy import units as u
from astropy.coordinates import SkyCoord
from astro... |
5791989f262aeca3b25523096facafae8ea178199d0907c19eb4dd6ca57d82db | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import matplotlib.lines
import matplotlib.pyplot as plt
import numpy as np
import pytest
from matplotlib import rc_context
from matplotlib.figure import Figure
from matplotlib.patches import Circle, Rectangle
from astropy import units as u
from astropy.co... |
14fd8f8c42cec7acc29fa743cb7c383a07c3fc1b1275c3bc9c046a02f2f568c9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the Slicing mixin to the NDData class.
from astropy import log
from astropy.wcs.wcsapi import BaseHighLevelWCS # noqa: F401
from astropy.wcs.wcsapi import BaseLowLevelWCS # noqa: F401
from astropy.wcs.wcsapi import HighLevelWCS... |
d391ccfe4744e2db57574d8fcf6f592925f8b1d68cc11274c79b4ce1b5ab3f06 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the Arithmetic mixin to the NDData class.
import warnings
from copy import deepcopy
import numpy as np
from astropy.nddata.nduncertainty import NDUncertainty
from astropy.units import dimensionless_unscaled
from astropy.utils im... |
2f9c9192647219aa8ba704de5530125c0879836d1ea0e22e3edd160f741df4c8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from packaging.version import Version
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.nddata import (
CCDData,
Cut... |
f0f6b8b6dc01c83c5044809eff00edc4f8eb24bd93f5251fc23a7d9920bb0e6b | from astropy.nddata import NDData, NDDataRef, NDIOMixin # noqa: F401
# Alias NDDataAllMixins in case this will be renamed ... :-)
NDDataIO = NDDataRef
def test_simple_write_read():
ndd = NDDataIO([1, 2, 3])
assert hasattr(ndd, "read")
assert hasattr(ndd, "write")
|
149f3f44e6b3a240eff1b1a059673ea9d876966b5d8384a89a10f25928bc029b | from .high_level_api import HighLevelWCSMixin
from .low_level_api import BaseLowLevelWCS
from .utils import wcs_info_str
__all__ = ["HighLevelWCSWrapper"]
class HighLevelWCSWrapper(HighLevelWCSMixin):
"""
Wrapper class that can take any :class:`~astropy.wcs.wcsapi.BaseLowLevelWCS`
object and expose the h... |
33386770e3bc2517cc44fb648db1cfb8d591346d30efcd1423c43ff78ef417ec | import abc
import os
import numpy as np
__all__ = ["BaseLowLevelWCS", "validate_physical_types"]
class BaseLowLevelWCS(metaclass=abc.ABCMeta):
"""
Abstract base class for the low-level WCS interface.
This is described in `APE 14: A shared Python interface for World Coordinate
Systems <https://doi.o... |
a046075e3d596c5d2d087a88d8571b731ac6d2ee602d370fbbff49a69342e3db | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import importlib
import numpy as np
__all__ = ["deserialize_class", "wcs_info_str"]
def deserialize_class(tpl, construct=True):
"""
Deserialize classes recursively.
"""
if not isinstance(tpl, tuple) or len(tpl) != 3:
raise Valu... |
9e3692370139b810029bce41113380fee7b552baa1b6ab54847ceddb546a7c19 | import abc
from collections import OrderedDict, defaultdict
import numpy as np
from .utils import deserialize_class
__all__ = ["BaseHighLevelWCS", "HighLevelWCSMixin"]
def rec_getattr(obj, att):
for a in att.split("."):
obj = getattr(obj, a)
return obj
def default_order(components):
order = [... |
6135d34e341cb9df086faf07d9379aeb6ccbdc898f3231d1532c67aa7163584d | # This file includes the definition of a mix-in class that provides the low-
# and high-level WCS API to the astropy.wcs.WCS object. We keep this code
# isolated in this mix-in class to avoid making the main wcs.py file too
# long.
import warnings
import numpy as np
from astropy import units as u
from astropy.consta... |
a83be5d734a205df3e02af3c2682cac25204014a4d612ecbaf7cc029d9636615 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def test_wtbarr_i(tab_wcs_2di):
assert tab_wcs_2di.wcs.wtb[0].i == 1
def test_wtbarr_m(tab_wcs_2di):
assert tab_wcs_2di.wcs.wtb[0].m == 1
def test_wtbarr_kind(tab_wcs_2di):
assert tab_wcs_2di.wcs.wtb[0].kind == "c"
def test_wtbarr_extna... |
dcea52b4b2d54edbba1c9a764c8bb46f393bb23f4159e1d3d48b6cedec2a3898 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import gc
import locale
import re
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from packaging.version import Version
from astropy import units as u
from astropy.io import fits
from astropy.unit... |
2a29c5a328db99846e77746e4cc63e20905e597b65c50ee09d7103f27ffd0d96 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.io import fits
class SimModelTAB:
def __init__(
self,
nx=150,
ny=200,
crpix=[1, 1],
crval=[1, 1],
cdelt=[1, 1],
pc={"PC1_1": 1, "PC2_2": 1},
):
# set... |
48a38d36dec6d244ac4789737eb24b01cb25499a87f93150b04e40322339d956 | import numbers
from collections import defaultdict
import numpy as np
from astropy.utils import isiterable
from astropy.utils.decorators import lazyproperty
from .base import BaseWCSWrapper
__all__ = ["sanitize_slices", "SlicedLowLevelWCS"]
def sanitize_slices(slices, ndim):
"""
Given a slice as input san... |
8e10e9fbaccfcab438b05e88dc51c00275e7c6770d8a587366286f17a4ea8266 | # Licensed under a 3-clause BSD style license - see LICNSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
# ... |
1000dc4736a96f20d8fdd02c246dbde24d7311ba0cbce58bcd3ff8e606773546 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
class Base:
"""
The abstract base class of all unit formats.
"""
registry = {}
def __new__(cls, *args, **kwargs):
# This __new__ is to make it clear that there is no reason to
# instantiate a Formatter--if you try to... |
33427ee69c8ffcee2c007963a48231b11975d38d125c1a922a9f28015aa25700 | # Licensed under a 3-clause BSD style license - see LICNSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
# ... |
47bf912252cd0092515f3e13e5b80e924bef5f9f9a0f728039ca7b681735ffee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# The idea for this module (but no code) was borrowed from the
# quantities (http://pythonhosted.org/quantities/) package.
"""Helper functions for Quantity.
In particular, this implements the logic that determines scaling and result
units for a given ufun... |
da5178ca0dc8c455a1fdb33c77c70a7f33e0d6d0cfbc9e6b538a58c23e3f444e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Converters for Quantity."""
import threading
import numpy as np
from astropy.units.core import (
UnitConversionError,
UnitsError,
UnitTypeError,
dimensionless_unscaled,
)
__all__ = [
"can_have_arbitrary_unit",
"converters_and... |
992e1058e1062093a4510ea7bd32f3184fb73795e932d7c463bb795b589f6f47 | # Licensed under a 3-clause BSD style license. See LICENSE.rst except
# for parts explicitly labelled as being (largely) copies of numpy
# implementations; for those, see licenses/NUMPY_LICENSE.rst.
"""Helpers for overriding numpy functions.
We override numpy functions in `~astropy.units.Quantity.__array_function__`.
... |
992f665c803a340b84245f400243d48312ffcbdbb3298498e3dff7959a3938b9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test the propagation of info on Quantity during operations."""
import copy
import numpy as np
from astropy import units as u
def assert_info_equal(a, b, ignore=set()):
a_info = a.info
b_info = b.info
for attr in (a_info.attr_names | b_i... |
9bfcd60aac55cd373f286d7962090d5a1834e4282354c4c98ba226e3fba26d79 | # The purpose of these tests are to ensure that calling quantities using
# array methods returns quantities with the right units, or raises exceptions.
import sys
import numpy as np
import pytest
from numpy.testing import assert_array_equal
from astropy import units as u
from astropy.utils.compat import NUMPY_LT_1_21... |
0a800faea5039750552079f4d032c82766ed678dc3aeebcc8dbed86ebfb4d5be | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Logarithmic Units and Quantities
"""
import itertools
import pickle
import numpy as np
import pytest
from numpy.testing import assert_allclose
from astropy import constants as c
from astropy import units as u
from astropy.tests.helper i... |
13246fd7beafa1a5908618361f644372178a8f8c09c3b6493f2e9c702753097b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test the Quantity class and related."""
import copy
import decimal
import numbers
import pickle
from fractions import Fraction
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
f... |
3015aef4c4ce4cbf3806f5f62215dd50e544396f49dffa4baba2bd18e8b44cb8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import itertools
import numpy as np
import numpy.lib.recfunctions as rfn
import pytest
from numpy.testing import assert_array_equal
from astropy import units as u
from astropy.units.quantity_helper.function_helpers import (
ARRAY_FUNCT... |
b4df3686b26a66274e8bacd997d95aaebf703963703bd5c6fdc16568a7e8c51e | # The purpose of these tests are to ensure that calling ufuncs with quantities
# returns quantities with the right units, or raises exceptions.
import concurrent.futures
import dataclasses
import warnings
from collections import namedtuple
import numpy as np
import pytest
from erfa import ufunc as erfa_ufunc
from num... |
d42b78e0b432d1373d85226ccae8a488c8a6224befb63f4ef4c2ba5205a8fd73 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numbers
import numpy as np
from astropy.units import (
CompositeUnit,
Unit,
UnitConversionError,
UnitsError,
UnitTypeError,
dimensionless_unscaled,
photometric,
)
from .core import FunctionQuantity, FunctionUnitBase
fr... |
a349c6d283a3f0a918be9f2d5e59b9c52c5649b9999fac435309b0fc2d40fa1c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Function Units and Quantities."""
from abc import ABCMeta, abstractmethod
import numpy as np
from astropy.units import (
Quantity,
Unit,
UnitBase,
UnitConversionError,
UnitsError,
UnitTypeError,
dimensionless_unscaled,
)
... |
30d5980e90fe62d27003d93c43591973e66170c11ca32f4a57dc885563bda4dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import units as u
from astropy.coordinates import earth_orientation as earth
from astropy.coordinates.attributes import TimeAttribute
from astropy.coordinates.baseframe import base_doc, frame_transform_graph
from astropy.c... |
f291400dd7058a145ec9f95c85296b1a38333fd9dfe3759739846d3f00cf9553 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates.attributes import EarthLocationAttribute, TimeAttribute
from astropy.coordinates.baseframe import BaseCoordinateFrame, base_doc
from astropy.coordinates.representation import (
CartesianDifferential,
CartesianRepresentatio... |
0725afa767d1bc586f37ef7f711a43876cbc91e621802b0cfde22647fd4027a1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions/values used repeatedly in different modules of
the ``builtin_frames`` package.
"""
import warnings
import erfa
import numpy as np
from astropy import units as u
from astropy.coordinates.earth import EarthLocation
from ... |
afe89d642143be65ed8f3e3d541b3c881dc447329519cace29d09a0fafe6f6da | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains the transformation functions for getting from ICRS/HCRS to CIRS and
anything in between (currently that means GCRS).
"""
import numpy as np
from astropy import units as u
from astropy.coordinates.baseframe import frame_transform_graph
from a... |
a9ef0fe821d335e3d4e4bf9204a396c37408ec24a19541ab9b08192b6cb3e484 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import units as u
from astropy.coordinates.attributes import CoordinateAttribute, QuantityAttribute
from astropy.coordinates.baseframe import BaseCoordinateFrame, frame_transform_graph
from astropy.coordinates.matrix_utilities import matrix_tr... |
45027909fa8e86331b8db6207f39616f78ba6f276a8a30754e717a5c18b8977e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.coordinates.baseframe import frame_transform_graph
from astropy.coordinates.matrix_utilities import matrix_transpose
from astropy.coordinates.transformations import DynamicMatrixTransform
from .fk4 import FK4NoETerms
fro... |
74ff7cdd4603070b44c5fd22248895a8be347c0e203463be761c2ad10c6d9b76 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import units as u
from astropy.coordinates import representation as r
from astropy.coordinates.attributes import DifferentialAttribute
from astropy.coordinates.baseframe import (
BaseCoordinateFrame,
RepresentationMapping,
base_do... |
c10be5d9eee92eacd2018a640bd0dd14a4c4f95ef54f610717a4b0995974ed51 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.coordinates.baseframe import frame_transform_graph
from astropy.coordinates.matrix_utilities import matrix_transpose, rotation_matrix
from astropy.coordinates.transformations import DynamicMatrixTransform
from .fk5 import FK5
from .icrs impo... |
12ed491ba8c97a7039f39ab86e665cab5a729939304afaa90ef18555babd0653 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from copy import deepcopy
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import EarthLocation, SkyCoord, galactocentric_frame_defaults
from astropy.coordinates import representation as r
from astropy.c... |
c241dd83c2fd9329c67d5e0ff46bd4ce3281bcb56d596789571956e6e1dee41b | """Test helper functions for coordinates."""
import numpy as np
def skycoord_equal(sc1, sc2):
"""SkyCoord equality useful for testing."""
if not sc1.is_equivalent_frame(sc2):
return False
if sc1.representation_type is not sc2.representation_type:
return False
if sc1.shape != sc2.shape:... |
37e23b333c4eefb14ed0af7871206edb08f61d4d09a10ce8794b8217c48dbbb6 | """
This series of functions are used to generate the reference CSV files
used by the accuracy tests. Running this as a command-line script will
generate them all.
"""
import os
import numpy as np
from astropy.table import Column, Table
def ref_fk4_no_e_fk4(fnout="fk4_no_e_fk4.csv"):
"""
Accuracy tests fo... |
ac9a8bb8df7223092faffd205ece957903bbf78da10a30c92482ed673d74f870 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import errno
import gzip
import http.client
import io
import mmap
import operator
import os
import re
import sys
import tempfile
import warnings
import zipfile
from functools import reduce
import numpy as np
# NOTE: Python can be built without bz2.
from ... |
76590403e445d506aedd3ba5e10f2144d7659a54efbf19924429755883eaa6f8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import warnings
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.io import registry as io_registry
from astropy.table import Column, MaskedColumn, Table, meta, serialize
from astropy.time impo... |
a9eb7d65967f32518b7cbf8bfd58f0fbafdf59880dfe8278c80e6597fd1a090e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Facilities for diffing two FITS files. Includes objects for diffing entire
FITS files, individual HDUs, FITS headers, or just FITS data.
Used to implement the fitsdiff program.
"""
import fnmatch
import glob
import io
import operator
import os
import... |
0f40e894732a8de671900e8304576c8829692189faa33370e3bc671fac8fd3f0 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import numbers
import operator
import re
import sys
import warnings
import weakref
from collections import OrderedDict
from contextlib import suppress
from functools import reduce
import numpy as np
from numpy import char as chararray
from as... |
44b5998d438a47640cdcedb02cbbf4e6cf81726ee157f8b8efa26595ee457794 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import collections
import copy
import itertools
import numbers
import os
import re
import warnings
from astropy.utils import isiterable
from astropy.utils.exceptions import AstropyUserWarning
from ._utils import parse_header
from .card import KEYWORD_LEN... |
f9760c7819677880031ea3ac57fdb7ddc3b35b3f929dc7955d8582a74b1bae1c | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import operator
import warnings
import weakref
from contextlib import suppress
from functools import reduce
import numpy as np
from numpy import char as chararray
from astropy.utils import lazyproperty
from .column import (
_VLF,
ASC... |
1be35a754b0fa76f7f27e61d9d50c419e7f55b5fbedf5bba5ec312bf61acc5e4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import warnings
from collections import OrderedDict, defaultdict
import numpy as np
from astropy import units as u
from astropy.coordinates import EarthLocation
from astropy.table import Column, MaskedColumn
from astropy.table.column import co... |
3622fb1e27f0c54825a18c048eaa0aea858c0af48d41e59ecf3bc8178d2415de | # Licensed under a 3-clause BSD style license - see PYFITS.rst
"""Convenience functions for working with FITS files.
Convenience functions
=====================
The functions in this module provide shortcuts for some of the most basic
operations on FITS files, such as reading and updating the header. They are
inclu... |
e119104bb67ab3a2c024203726351d8a4a343033ca03c7522262a6ba19e026e2 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
import itertools
import mmap
import operator
import os
import platform
import signal
import sys
import tempfile
import textwrap
import threading
import warnings
import weakref
from contextlib import contextmanager, suppress
from funct... |
36e22d62f022e6f690f26f495d551b68459d0173b55bea3a9fa83947b288e31e | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import re
import warnings
import numpy as np
from astropy.utils.exceptions import AstropyUserWarning
from . import conf
from .util import _is_int, _str_to_num, _words_group, translate
from .verify import VerifyError, VerifyWarning, _ErrList, _Verify
__... |
ffae35f8f558c66de3af4929ad80fe0813cc9427a7e2e41b70fde17fd30db614 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import operator
import warnings
from astropy.utils import indent
from astropy.utils.exceptions import AstropyUserWarning
class VerifyError(Exception):
"""
Verify exception class.
"""
class VerifyWarning(AstropyUserWarning):
"""
Ver... |
82382bc451297ab3252dc17967fe427faae0e6e4cd966a6430bcf0a2d6427d69 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
cds.py:
Classes to read CDS / Vizier table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import fnmatch
import itertools
impor... |
a79dacaf155ed04bc6baf3831b9a60af6ccccadebecd9ae5adaefc1d8994995d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
basic.py:
Basic table read / write functionality for simple character
delimited files with various options for column header definition.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author:... |
14603332851a5c71b5f5833bbe8f1198b0b566204b77688d9fedf3d6637eed10 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
core.py:
Core base classes and functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import copy
im... |
aea9d8a4080b8ddda11ed9ac1f81d783b4877fcaec6e985bb77a54931d531ecc | # Licensed under a 3-clause BSD style license
"""
:Author: Simon Gibbons (simongibbons@gmail.com).
"""
from .core import DefaultSplitter
from .fixedwidth import (
FixedWidth,
FixedWidthData,
FixedWidthHeader,
FixedWidthTwoLineDataSplitter,
)
class SimpleRSTHeader(FixedWidthHeader):
position_line... |
d81c5bbd7e24232c0be88075c2bdcc4172110bcee561f8d6f01a3d2793e873c1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
fixedwidth.py:
Read or write a table with fixed width columns.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
from . import basic, cor... |
bdcd10f8ae3dcbbee8b0114a8c15240f42408af0d1aa6f57f776baf230854a89 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Classes to read AAS MRT table format.
Ref: https://journals.aas.org/mrt-standards
:Copyright: Smithsonian Astrophysical Observatory (2021)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu), \
Suyog Garg (suyog7130@gmail.com)
"""
import r... |
073ee8f0573ea5eccd176c703eb383217f4536b8c7f91d6977100ef5757e85ba | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
latex.py:
Classes to read and write LaTeX tables
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from . import core
latexdi... |
2c6ea5ffd18980c2255e010f4501fe77cfe066178cf2e68658bc2ca9d2a912d2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ipac.py:
Classes to read IPAC table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from collections import OrderedDic... |
5c8027c4a4005583488601781ba96a88b293a5f7693685bed3be8bff2eff749e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible HTML table reader and writer.
html.py:
Classes to read and write HTML tables
`BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
must be installed to read HTML tables.
"""
import warnings
from copy import deepcopy
from a... |
cb9468c4768fe9de4087775a6fb6145df573b1dc397148143a7f344af06b6b29 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""sextractor.py:
Classes to read SExtractor table format.
Built on daophot.py:
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from . import core
class SExtractorHeader(c... |
db64d64d72e032b6975da362dbd55f875f10942fbb9c868b14f96c5de06f2cb7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing QDP tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`astropy:table_io` for more details.
"""
import copy
import re
import w... |
93da0dc5d05063d5db3ccbb710f03d8378a3f7bd6a14795a112a26e8695c6d64 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ui.py:
Provides the main user functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import collecti... |
874fd27dfec6a0e68aa8905a8a0d48da7b654375e7705f09d96492e6be5afb87 | """A Collection of useful miscellaneous functions.
misc.py:
Collection of useful miscellaneous functions.
:Author: Hannes Breytenbach (hannes@saao.ac.za)
"""
import collections.abc
import itertools
import operator
def first_true_index(iterable, pred=None, default=None):
"""find the first index position for ... |
c5f522e7462d8778be7494846b43db5552e6ed314b673e4dfd4791766b30c2ec | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
An extensible ASCII table reader and writer.
Classes to read DAOphot table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import itertools as itt
import re
from collections ... |
5155bcddcbb0225545119ef5fd5c922dd7f28743f37e03555d239aaa6cb5fb00 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define the Enhanced Character-Separated-Values (ECSV) which allows for reading and
writing all the meta data associated with an astropy Table object.
"""
import json
import re
import warnings
from collections import OrderedDict
import numpy as np
fr... |
ee10d80c4e39f03437e0f3526f9abc1d5147129e3cb33795874854ddadaf2c2b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing HDF5 tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`astropy:table_io` for more details.
"""
import os
import warnings
i... |
6bfc3674c43b96516f353029896e79bc84a763af779a20d31b652b34e7cd96c5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for serializing astropy objects to YAML.
It provides functions `~astropy.io.misc.yaml.dump`,
`~astropy.io.misc.yaml.load`, and `~astropy.io.misc.yaml.load_all` which
call the corresponding functions in `PyYaml <https://pyyaml.org>`_ but use ... |
8ea8951a245b12f62413ad9020e64c3eb1d2a0ae66d68af0bc5a848ef3abacd5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple input/output related functionality that is not
part of a larger framework or standard.
"""
import pickle
__all__ = ["fnpickle", "fnunpickle"]
def fnunpickle(fileorname, number=0):
"""Unpickle pickled objects from a s... |
9291825dcec3a872ff2a645ba7e88e3cb95f3fe28150476804d14fd0dd8e7f25 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing Parquet
tables that are not meant to be used directly, but instead are
available as readers/writers in `astropy.table`. See
:ref:`astropy:table_io` for more details.
"""
import os
import warning... |
6d59800503e8b23822f820d7448f7f97f8cd3e127b1c8c253388bab6dd45308d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Mixin columns for use in ascii/tests/test_ecsv.py, fits/tests/test_connect.py,
and misc/tests/test_hdf5.py.
"""
import numpy as np
from astropy import coordinates, table, time
from astropy import units as u
el = coordinates.EarthLocation(x=[1, 2] * ... |
5baf5183c768c5c56f859d38eabb2f94a083a36c8491a72399319f01fe1faa27 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
class CatchZeroByteWriter(io.BufferedWriter):
"""File handle to intercept 0-byte writes."""
def write(self, buffer):
nbytes = super().write(buffer)
if nbytes == 0:
raise ValueError("This writer does not all... |
ac57120a86ebf13026e8b594d5cf9e204ce8ed6915c3fa763d0c6514c109c5a1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
from collections import OrderedDict
from .base import IORegistryError, _UnifiedIORegistryBase
__all__ = ["UnifiedIORegistry", "UnifiedInputRegistry", "UnifiedOutputRegistry"]
PATH_TYPES = (str, os.PathLike) # TODO! include bytes
... |
03bc10343aabf53bdd70da65ccbccab659589f21c44b5df7de1b16b300fa673b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
import contextlib
import re
import warnings
from collections import OrderedDict
from operator import itemgetter
import numpy as np
__all__ = ["IORegistryError"]
class IORegistryError(Exception):
"""Custom error for registry clashes."""
... |
e3888f94e0e85e5e39d15109525711755c47e1080d3d2fb697924fd9c8d1136d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import os
import re
from .base import IORegistryError
__all__ = ["UnifiedReadWriteMethod", "UnifiedReadWrite"]
# -----------------------------------------------------------------------------
class UnifiedReadWrite:
"""Base class f... |
68f6718aeb8498de9e4232475ef7089e32ae699010cf7e6b913cc2ae3133d20c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module handles the conversion of various VOTABLE datatypes
to/from TABLEDATA_ and BINARY_ formats.
"""
# STDLIB
import re
import sys
from struct import pack as _struct_pack
from struct import unpack as _struct_unpack
# THIRD-PARTY
import numpy ... |
fcd6dff09ce82061cf2c9dfba64488a37ded7eaf8bac50bdc877b8ad757618fc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from astropy.io import registry as io_registry
from astropy.table import Table
from astropy.table.column import BaseColumn
from astropy.units import Quantity
from astropy.utils.misc import NOT_OVERWRITING_MSG
from . import from_table, parse
f... |
2eef0ff6c21da81751112a5e5d6a53da7530c619bc9dafc8486a2211a2bbb181 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import base64
import codecs
import gzip
import io
import re
import urllib.request
import warnings
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy import __version__ as astropy_version
from as... |
ee6dbc01481592eb921156fd0228afd3b70065f3dbdb2d290771f813cc6aa646 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains a contains the high-level functions to read a
VOTable file.
"""
# STDLIB
import io
import os
import sys
import textwrap
import warnings
from astropy.utils import data
from astropy.utils.decorators import deprecated_renamed_argumen... |
2c040bed1758d99eaf3ff285b01257af11106cd1bf5783ccf6ef60016af16c29 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""VOTable exceptions and warnings.
.. _warnings:
Warnings
--------
.. note::
Most of the following warnings indicate violations of the VOTable
specification. They should be reported to the authors of the
tools that produced the VOTable fil... |
9e2345a86e6f36939ffa4a2503ced1e214103debbbe8df2d5edc7efca5d20359 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various XML-related utilities.
"""
# ASTROPY
from astropy.logger import log
from astropy.utils import data
from astropy.utils.xml import check as xml_check
from astropy.utils.xml import validate
# LOCAL
from .exceptions import W02, W03, W04, W05, vo... |
487d1db23388913415045b30ec17e991ddc6b4e4ba07d60095d419e4cca8accc | from .tiled_compression import *
|
47a15e081acb2f1a9674b2c30e8f5879d0aa5c07cbb26408552e354b4a5ada61 | """
This module contains the FITS compression algorithms in numcodecs style Codecs.
"""
from gzip import compress as gzip_compress
from gzip import decompress as gzip_decompress
import numpy as np
from astropy.io.fits._tiled_compression._compression import (
compress_hcompress_1_c,
compress_plio_1_c,
comp... |
38f9ef28cd8ca6fdc1274dbf1bd47a6bf8064a5110070ba6e5ae08174f18d5f1 | # Licensed under a 3-clause BSD style license
import os
from collections import defaultdict
from setuptools import Extension
from extension_helpers import pkg_config
SRC_DIR = os.path.join(os.path.dirname(__file__), "src")
def get_extensions():
cfg = defaultdict(list)
cfg["sources"].extend(
[
... |
0f90ad40beb55abf7f3e118ef39fcaa57659806e0ecc4076d85190ff53a78065 | import numpy as np
def _iter_array_tiles(data_shape, tile_shape):
"""
Given an array shape and a tile shape, iterate over the tiles in the array
returning at each iteration the slices for the array.
"""
ndim = len(data_shape)
istart = np.zeros(ndim, dtype=int)
while True:
# In th... |
8d37027655976aeaa1741d4e2123ded92f50c30e360ed8d7365cb442087f3735 | """
This module contains low level helper functions for compressing and
decompressing buffer for the Tiled Table Compression algorithms as specified in
the FITS 4 standard.
"""
import sys
import numpy as np
from astropy.io.fits.hdu.base import BITPIX2DTYPE
from .codecs import PLIO1, Gzip1, Gzip2, HCompress1, Rice1
... |
c39c3cf21d48fa1b4b5ab8fecf5a5878be7b8f81aed36f1715a9b62d3d983e31 | """
This file contains the code for Quantizing / Dequantizing floats.
"""
import numpy as np
from astropy.io.fits._tiled_compression._compression import (
quantize_double_c,
quantize_float_c,
unquantize_double_c,
unquantize_float_c,
)
from astropy.io.fits.hdu.base import BITPIX2DTYPE
__all__ = ["Quant... |
651ac114c8e131fd4cdf25f45ab51b0921a3073dc22cc9746f7b7af69d7c43b9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsheader`` is a command line script based on astropy.io.fits for printing
the header(s) of one or more FITS file(s) to the standard output in a human-
readable format.
Example uses of fitsheader:
1. Print the header of all the HDUs of a .fits fil... |
3409caaa742c8846e972a93a1c0e6cb9c0b63d00d4b9d1f766179cec927f313a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitscheck`` is a command line script based on astropy.io.fits for verifying
and updating the CHECKSUM and DATASUM keywords of .fits files. ``fitscheck``
can also detect and often fix other FITS standards violations. ``fitscheck``
facilitates re-wri... |
445a7cd2a9f126803e6c26b3363b428721b430e5f7969339ec295a01e84a0c3c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsinfo`` is a command-line script based on astropy.io.fits for
printing a summary of the HDUs in one or more FITS files(s) to the
standard output.
Example usage of ``fitsinfo``:
1. Print a summary of the HDUs in a FITS file::
$ fitsinfo file... |
182d255a3475ef85f3f575ed3ce50877d944e87624ba7cc6e7da71c12eac003b | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from astropy.io.fits.column import FITS2NUMPY, ColDefs, Column
from astropy.io.fits.fitsrec import FITS_rec, FITS_record
from astropy.io.fits.util import _is_int, _is_pseudo_integer, _pseudo_zero
from astropy.utils import la... |
0196b8f8570cfc4a89f4d8b08be5ebd1175092ab9d3bf381775e7814c892ff14 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import csv
import operator
import os
import re
import sys
import textwrap
import warnings
from contextlib import suppress
import numpy as np
from numpy import char as chararray
# This module may have many dependencies on astropy.io.fit... |
32c169c5b61bf6b7e7f052294247b0f5d42a4e8f8ad9ad44e6ef6ed3eec807a4 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
from astropy.io.fits.file import _File
from astropy.io.fits.header import Header, _pad_length
from astropy.io.fits.util import fileobj_name
from astropy.utils import lazyproperty
from .base import NonstandardExtHDU
from .hdulist imp... |
60261a692853654c4832843f033e4bfe00938fba4e2cad5c1c1f638dc4dceebc | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import mmap
import sys
import warnings
import numpy as np
from astropy.io.fits.header import Header
from astropy.io.fits.util import (
_is_dask_array,
_is_int,
_is_pseudo_integer,
_pseudo_zero,
)
from astropy.io.fits.verify import VerifyW... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.