hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
c5d9496eaade4e75fcbc9f1361e0a16dbe525627df412308b5114950fa6c5de0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import warnings
from collections import defaultdict, OrderedDict
import numpy as np
from . import Header, Card
from astropy import units as u
from astropy.coordinates import EarthLocation
from astropy.table import Column, MaskedColumn
from as... |
43e72109cb847ff216a0aa4886fa4a3f6703c301b81a56adb96836fed01256fd | # Licensed under a 3-clause BSD style license - see PYFITS.rst
"""
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
included directly in the 'astropy.io.fits' namespace so ... |
aa3470d612f8f1d2581e3c68354da5b7a409b48840171def98e5afe4856b8ca5 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import os
import sys
from collections import defaultdict
from setuptools import Extension
from glob import glob
import numpy
from extension_helpers import pkg_config, get_compiler
def _get_compression_extension():
debug = '--debug' in sys.argv
... |
05fc8f4165d33ed735110c341eb941fe2ae09c9082bccdfb168b0f457b8d18ca | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import itertools
import io
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... |
f6066757f138dabd0a2e02ab9f3974a2a995a2a4c6c4b6a1738e02f2ca5d1c68 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import re
import warnings
import numpy as np
from .util import _str_to_num, _is_int, translate, _words_group
from .verify import _Verify, _ErrList, VerifyError, VerifyWarning
from . import conf
from astropy.utils.exceptions import AstropyUserWarning
_... |
bf3ca465363633ee6ef65cdf7f103fde34a787f1413937a4d4321de7c965512d | # 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... |
af2877a87be49457b52ea659f070d9c520d6f15e69ecc9c31216c6b739c40926 | # 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... |
9e8ca0b1f63d9f8778c0355597e8558234d43a8f7246be805a1e1ca2fd702fe9 | # 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:... |
35ae810d766cb33a4b2bb458d876d9e47221f20e65139607c2398308799cf8f9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects the readers/writers to the astropy.table.Table class
import re
from astropy.io import registry as io_registry # noqa
from astropy.table import Table
__all__ = []
def io_read(format, filename, **kwargs):
from .ui import read
... |
463f9281a8aa4912821c33a93d6df516655605807d14d93b67966366481757f4 | # 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
i... |
f9abd13f80318eeb8570e8aa23b9f475f1d9f423b7725ca34a6a814acb3a7e7e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" An extensible ASCII table reader and writer.
"""
# flake8: noqa
from .core import (InconsistentTableError,
ParameterError,
NoType, StrType, NumType, FloatType, IntType, AllType,
Column,
... |
60c39b976b696add435ca480b412aead0f879f001c954bc9a00411e6ec8b4c08 | # 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)
cla... |
957c52dcd08315e7ce8093809628fe2ff1aeee41765e6c637bd22ed7e5311393 | # 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 core
from ... |
ca686dc238db232132ebb3ede96cc6150001c607b144fc4228f8014022c6322e | # 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 re... |
240424c0a450d343ca2cb47da07cbfddb50e5b0ab1c9085c63847473837c2000 | # 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... |
7ab8f73fc14254c3f023929843569c86e6c6c023e3089b9691b0b0e0857cba1e | # 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 defaultdic... |
81fc22adb58f2a26869d42bdd2d3f95822ebfb1d76fbf9b28f70afd4b6a2b98c | # Licensed under a 3-clause BSD style license
import os
from setuptools import Extension
import numpy
ROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = [os.path.join(ROOT, 'cparser.pyx'),
os.path.join(ROOT, 'src', 'tokenizer.c')]
ascii_ext = Extension(
... |
35bae6d01df1e64718624bbe60de11adc1435d90bf37469d609be4490562c1cf | # 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 . import core
from astropy.... |
656424e513aace8e64ed7b7c4891c34b059784f6f56b4e2e00c818cbff1b9854 | # 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... |
fb6c80f651e0c39c7bd0e8a4b20ff90ea44733dd0218aa83fb8645f0873bade9 | # 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 re
import copy
from col... |
05143af71f1c31d4d9c7c4c9f0db707811c48991d311d3e27c1b575a58aeedd1 | READ_DOCSTRING = """
Read the input ``table`` and return the table. Most of
the default behavior for various parameters is determined by the Reader
class.
See also:
- https://docs.astropy.org/en/stable/io/ascii/
- https://docs.astropy.org/en/stable/io/ascii/read.html
Parameters
-----... |
306d62651ecb1ac1a74b0a19bac7938098484818e2d79834603d2024829fcfea | # 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 re
impor... |
061fe343b22ddbc5d18100e1595430beb513aeb22826ad81d5cdbfbe04ca461c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import copy
from collections import OrderedDict
from . import core
from astropy.table import Table
from . import cparser
from astropy.utils.misc import _set_locale
class FastBasic(metaclass=core.MetaBaseReader):
"""
This class is inte... |
36ec683cecdc7c8c3fba35414ca371e875d9df97ee3b592cb135619c6465efaf | """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 ... |
ba4c8817d364d7211a4f5240bf605571a7e404413f8c58553c8696aaba6db254 | # 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 re
import numpy as np
import itertools as it... |
7402d79396e23e87325fb4336e9a4fe9ce74f2fa461057a16070d34ed2911fae | # 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 re
from collections import OrderedDict
import warnings
import json
import numpy as np
fr... |
0d3fd214c27a07d48bc728642f99b76e39e7732589b3432fd6d7a9bb01cabfb2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects any readers/writers defined in io.misc to the
# astropy.table.Table class
from . import hdf5
from . import parquet
hdf5.register_hdf5()
parquet.register_parquet()
|
81ac234d2d497c6cbc78285a254156ca16f0b6133fede4631f73300004620402 | # 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... |
b8f41234d7ae7c7bc24e39c66eef09a97381fe89d6f73102d6345db0273ff5bb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains miscellaneous utility functions for data
input/output with astropy.
"""
from .pickle_helpers import *
|
3b8fada64dd44ee59b88cdb016b75f9330f58d454c635dde405bfec9327befa9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for serializing core astropy objects via the
YAML protocol.
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... |
55b43c2dfcc452ebe34a9584131fe68d9e5901599a2f552fe4682ab0429078f2 | # 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 ... |
203525835af727fab74268884b58d3cb2e38dc6820ec8ee461dfb008b9ebeb61 | # 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... |
62e005a982b482d17a40bc54e31a748b7e6c040221eabe5bdb0daf71821ad3bf | # 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
"""
from astropy import coordinates, table, time, units as u
el = coordinates.EarthLocation(x=[1, 2] * u.km, y=[3, 4] * u.km, z=[5, 6] * u.km)... |
550b062f4573e4d612268f6e576262b9f6955f4427a7be8e178c55087b3ec105 | # 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 allo... |
29e73944e3febcf5c810278b88f377b650c53540cad7856ef26917dbe2cff58c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
from collections import OrderedDict
import numpy as np
from .base import IORegistryError, _UnifiedIORegistryBase
__all__ = ['UnifiedIORegistry', 'UnifiedInputRegistry', 'UnifiedOutputRegistry']
PATH_TYPES = (str, os.PathLike) # ... |
6e3a64cbace0325707e47904b4987c5baf5a5a267f4d3e35308634eb88962d01 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Unified I/O Registry.
"""
from . import base, compat, core, interface
from .base import *
from .compat import *
from .compat import _identifiers, _readers, _writers # for backwards compat
from .core import *
from .interface import *
__all__ = core._... |
3364f4b2e36baa83fa21d685a9c4b90a14c08c3365378a95afba1691c944e0dd | # 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.
... |
bfe0e77aef5444aa2f855ebcca6c952422c9414ea9d7c6a1e240867222198106 | # 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 fo... |
9c06cf046fa0118ec08b4637e97e5d9a4bc6e920967128457fee165ca99989ae | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import sys
from .core import UnifiedIORegistry
__all__ = ["register_reader", "register_writer", "register_identifier", # noqa: F822
"unregister_reader", "unregister_writer", "unregister_identifier",
"get_reader", ... |
6444d437fcd5fd3fde9dcc57e138d495586591eeb8f4dace9d0a26554e25ccd8 | # 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 unpack as _struct_unpack
from struct import pack as _struct_pack
# THIRD-PARTY
import numpy ... |
7414432d8ce84775019d8140893e4ad0cb6119869bfa788b8211102a0672543c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from . import parse, from_table
from .tree import VOTableFile, Table as VOTable
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... |
c0f407b14507566fa2c3d96935240deca7f8d2dabf9d960eee21ec79c1eaea2a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import io
import re
import gzip
import base64
import codecs
import urllib.request
import warnings
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy.io import fits
from astropy import __version_... |
d26fb1dbdfb4dd502407a1078fa8b1f805736e10f95779dc3ab4ea6f958b2f03 | # 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
# LOCAL
from . import exceptions
from . import tree
from astropy.utils.xml import iterparser
f... |
6f0eb5e8428456c3cec1eb1f695bf0b607705904d49ddd74414272eae3bf45b0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package reads and writes data formats used by the Virtual
Observatory (VO) initiative, particularly the VOTable XML format.
"""
from .table import (
parse, parse_single_table, validate, from_table, is_votable, writeto)
from .exceptions impor... |
d97d5c9d65d26c13401d280ee5756edfe12704eb8f8794aed4febe44835ae09c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
.. _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 file.
T... |
ad09e7fa46757019e532a792a3e77d55d153b9962d53a565b76e3edb395b30f8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains routines to verify the correctness of UCD strings.
"""
# STDLIB
import re
# LOCAL
from astropy.utils import data
__all__ = ['parse_ucd', 'check_ucd']
class UCDWords:
"""
Manages a list of acceptable UCD words.
Work... |
8fae8c1d57d7f157e49e07dc2c4298abb8d2ebcaef46322216a936aea5a350c1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from setuptools import Extension
from os.path import join
def get_extensions(build_type='release'):
VO_DIR = 'astropy/io/votable/src'
return [Extension(
"astropy.io.votable.tablewriter",
[join(VO_DIR, "tablewriter.c")],
... |
4d35e041e938a6c595302fd62694bc19482a6b6b050b24935e1677fabbc1584f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various utilities and cookbook-like things.
"""
# STDLIB
import codecs
import contextlib
import io
import re
import gzip
from packaging.version import Version
__all__ = [
'convert_to_writable_filelike',
'stc_reference_frames',
'coerce_... |
76bcae3b908fe348b782656e238cfc9b7960962eb42d09dd423573557376414f | # 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 (warn_or_raise, vo_warn... |
ee064974f910cd9be53fc8550ede669b89e94a8dc66cafe10bb0cf0a5737aa0c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Script support for validating a VO file.
"""
def main(args=None):
from . import table
import argparse
parser = argparse.ArgumentParser(
description=("Check a VOTable file for compliance to the "
"VOTable spec... |
391f7442fd8d316ddf767e0a720f5ce4d929a4faef171b2af2f08f83e8305b47 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains implementations of command-line scripts that are
included with Astropy.
The actual scripts that are installed in bin/ are simple wrappers for these
modules that will run in any Python version.
"""
|
f89fc41b35a54f1d6ceb4bd2cdee5c6644a5ac96686a811edbb2daa98bb31b11 | # 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... |
a2fc679a44f101c8bbc2db0dd27befdac5435fc7aec15ad23d996ca3ba6e28c6 | # 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... |
373f3abd34ed75e1319d06c3537bcb1c535ac96428d68875832e11708c01cc79 | # 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... |
1f472f3e9488aaedef13bccbb0317123a60726dea4d2ecf814489f1ff64e85ce | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import argparse
import glob
import logging
import os
import sys
from astropy.io import fits
from astropy.io.fits.util import fill
from astropy import __version__
log = logging.getLogger('fitsdiff')
DESCRIPTION = """
Compare two FITS image files and re... |
4cc69644f0a8178ab5450c7ec58d2c781b631fb3e763e28c822c7ba9d953820f | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from .base import DTYPE2BITPIX, DELAYED
from .image import PrimaryHDU
from .table import _TableLikeHDU
from astropy.io.fits.column import Column, ColDefs, FITS2NUMPY
from astropy.io.fits.fitsrec import FITS_rec, FITS_record
f... |
305f57c4aa7802b29b95988e73c022d9a4b0a1811d4fc3a05c88f3fccf0f5275 | # 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
from .base import DELAYED, _ValidHDU, ExtensionHDU
# This ... |
6504816f5e310d4aadf1f8c5405c48df53c8875a4815851b2e76775309929c09 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
from .base import (register_hdu, unregister_hdu, DELAYED, BITPIX2DTYPE,
DTYPE2BITPIX)
from .compressed import CompImageHDU
from .groups import GroupsHDU, GroupData, Group
from .hdulist import HDUList
from .image import PrimaryHDU, ImageH... |
5a2a18229a922e64f4778406ebcf37051944ff4e4522dd629536968596e338a3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
from astropy.io.fits.file import _File
from .base import NonstandardExtHDU
from .hdulist import HDUList
from astropy.io.fits.header import Header, _pad_length
from astropy.io.fits.util import fileobj_name
from astropy.utils import l... |
15b2c3a78a923a2ebed91581b705605f23aec1056c22accd481b26d6703626cf | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import mmap
import warnings
import numpy as np
from .base import DELAYED, _ValidHDU, ExtensionHDU, BITPIX2DTYPE, DTYPE2BITPIX
from astropy.io.fits.header import Header
from astropy.io.fits.util import (_is_pseudo_integer, _pseudo_zero, _is_int... |
055361311d29f4c23b3ea09f45c07175e2f1ac7d34f36368ded4f724568e28a6 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import ctypes
import gc
import itertools
import math
import re
import time
import warnings
from contextlib import suppress
import numpy as np
from .base import DELAYED, ExtensionHDU, BITPIX2DTYPE, DTYPE2BITPIX
from .image import ImageHDU
from .table impo... |
562b11c97eee636792e3f741d596fdd90cfcb813be3e45835035fa3770718d5f | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import datetime
import os
import sys
import warnings
from contextlib import suppress
from inspect import signature, Parameter
import numpy as np
from astropy.io.fits import conf
from astropy.io.fits.file import _File
from astropy.io.fits.header import (... |
2b92276f39a3eb67eb6513605551fa64ca36e29f33797f665940a6627e08e255 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import itertools
import os
import re
import shutil
import sys
import warnings
import numpy as np
from . import compressed
from .base import _BaseHDU, _ValidHDU, _NonstandardHDU, ExtensionHDU
from .groups import GroupsHDU
from .image import Pr... |
798ea2e07ba2e31691e37b55871debfde99586b100814992c037f4cd35544158 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import os
from .base import _BaseHDU, BITPIX2DTYPE
from .hdulist import HDUList
from .image import PrimaryHDU
from astropy.io.fits.file import _File
from astropy.io.fits.header import _pad_length
from astropy.io.fits.util import fileobj_name
... |
8f1e0a86830e8df8e636c0a5ff20dafa2913d47de09a56a46f82db480f81e324 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import copy
import gc
import pickle
import re
import sys
import warnings
import pytest
import numpy as np
from numpy import char as chararray
try:
import objgraph
HAVE_OBJGRAPH = True
except ImportError:
HAVE_OBJGRAPH = Fals... |
75cb67228946f836bd76c48fb1033affb19eb26d1b8317cb31a02ba0173c0a9c | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import warnings
import pytest
import numpy as np
from .test_table import comparerecords
from astropy.io.fits.hdu.base import _ValidHDU
from astropy.io import fits
from . import FitsTestCase
class TestChecksumFunctions(FitsTestCase):
# ... |
dcc23d93297614ecd3ecaac3ae6889fd0fac4decdf1dda2af14cef6fb953ab4f | # 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('... |
cb426b1d745b8ffe005dfc541cd41b61e58b970bfd38f0f6f221b6293970b02e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import time
import pytest
import numpy as np
from . import FitsTestCase
from .test_table import comparerecords
from astropy.io import fits
class TestGroupsFunctions(FitsTestCase):
def test_open(self):
with fits.open(self.data('ra... |
ce61c27c8856d76b3286f9e8267ed78b295ac097cd326c6571323596c2af2002 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
from astropy.io import fits
from . import FitsTestCase
class TestNonstandardHdus(FitsTestCase):
def test_create_fitshdu(self):
"""
A round trip test of creating a FitsHDU, adding a FITS file to it,
writing ... |
483fcc88038974a01251b89e684c816a68e1d35bd168447e1132ee3bbf917608 | # 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... |
c47ee9c3902202e2a8b04bc163666c351a35882c00e4fb0e6880e05810e61805 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import pytest
from . import FitsTestCase
from astropy.io.fits.scripts import fitscheck
from astropy.io import fits
from astropy.utils.exceptions import AstropyUserWarning
from astropy import __version__ as version
class TestFitscheck(FitsTestC... |
e8e1aec7e5fd0394733bd1f7f7d342c5a1474206b95653fed5471155c113d424 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import os
import shutil
import stat
import tempfile
import time
from astropy.io import fits
class FitsTestCase:
def setup(self):
self.data_dir = os.path.join(os.path.dirname(__file__), 'data')
self.temp_dir = tempfile.mkdtemp(prefix=... |
c36147bf06a6d6ec8088ea226b73f807b3effda82cf14490372c6689a6c9099b | # Tests related to writing dask arrays to FITS files in an efficient way
import pytest
import numpy as np
from astropy.io import fits
from astropy.io.fits import ImageHDU, PrimaryHDU
da = pytest.importorskip("dask.array")
@pytest.fixture
def dask_array_in_mem():
return da.random.uniform(-1000, 1000, (1322, 755... |
2a7af12f824ee1947ca618c3e7e9fe6f86bbdb5ab7014d8c7d6858ca7066a7c1 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import os
import pathlib
import warnings
import io
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from astropy.io import fits
from astropy import units as u
from astropy.table import Table
from astropy.io.fits import printd... |
a8d8694663af3b911ae8d56e092230bb690797b3cc7c3478ba67f187291046b6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import signal
import gzip
import pytest
import numpy as np
from numpy.testing import assert_equal
from astropy.io.fits import util
from astropy.io.fits.util import ignore_sigint, _rstrip_inplace
from astropy.utils.compat.optional_deps import H... |
64c89579f3cc8dc8a7dbbfdfa8edbefa9c46f81002e32302f164b499c6f9d291 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.io.fits.column import Column
from astropy.io.fits.diff import (FITSDiff, HeaderDiff, ImageDataDiff,
TableDataDiff, HDUDiff)
from astropy.io.fits.hdu import HDUList, PrimaryHDU... |
6967703a1d3052632b91d4eded0e0574cb0cb9ba08ffed8657446dfed46320b5 | # -*- coding: utf-8 -*-
# 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
from astropy.utils.exceptions import As... |
d3f36b79e69671ed41d71bb4eeed34953d642be377033a321f7c9ca73db6aca4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import os
from . import FitsTestCase
from astropy.io.fits.convenience import writeto
from astropy.io.fits.hdu import PrimaryHDU, hdulist
from astropy.io.fits import Header, ImageHDU, HDUList, FITSDiff
from astropy.io.fits... |
c129df5b8d91b4d8dc1bbf1ffbc03e8123f804eca7417d2abd8aeda6a3b201eb | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from astropy.io import fits
from . import FitsTestCase
def compare_arrays(arr1in, arr2in, verbose=False):
"""
Compare the values field-by-field in two sets of numpy arrays or
recarrays.
"""
arr1 = arr1... |
6a726b359d1c7be0efbaffaa639cb0c73a99abdbe124267725db83ffed56686a | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import pytest
import numpy as np
from astropy.io import fits
from astropy.io.fits.compression import compress_hdu
from . import FitsTestCase
MAX_INT = np.iinfo(np.intc).max
MAX_LONG = np.iinfo(int).max
MAX_LONGLONG = np.iinfo(np.longlong).max
class T... |
4e7e720aadee6ab8ec86fb65e9957d7e28d78acfe13207b1841639b25cc32e2d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from . import FitsTestCase
from astropy.io.fits.scripts import fitsheader
from astropy import __version__ as version
class TestFITSheader_script(FitsTestCase):
def test_help(self):
with pytest.raises(SystemExit) as e:
... |
51dee56fc92cb551425b6fa0830ee95e4af1a68842eb317f1882b5a2fc7aab55 | import gc
import pathlib
import warnings
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from astropy.io.fits.column import (_parse_tdisp_format, _fortran_to_python_format,
python_to_tdisp)
from astropy.io.fits import HDUList, Primary... |
262595418347ad56669e90328f67fdf8e2daf3c9488cacfac7b6b77d32c22224 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
import mmap
import errno
import os
import pathlib
import shutil
import urllib.request
import zipfile
from unittest.mock import patch
import pytest
import numpy as np
from . import FitsTestCase
from astropy.io.fits.convenience impor... |
33ba596d4aa13b5f857a4a0736d7724432c2282caa44756bb8184166282a8650 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from . import FitsTestCase
from astropy.io.fits.fitstime import GLOBAL_TIME_INFO, time_to_fits, is_time_column_keyword
from astropy.coordinates import EarthLocation
from astropy.io import fits
from astropy.table import T... |
c876233bb17bbce8388e16f5263d8d8d7da36f9a84bed671f49dfd6501f57ad9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from . import FitsTestCase
from astropy.io.fits.scripts import fitsinfo
from astropy import __version__ as version
class TestFitsinfo(FitsTestCase):
def test_help(self):
with pytest.raises(SystemExit) as e:
fitsin... |
7bc7129b60de5cb13ad8997c2adcd9650eb03c8bca7112a1387dcb82510047e3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import platform
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from astropy.io import fits
from . import FitsTestCase
class TestUintFunctions(FitsTestCase):
@classmethod
def setup_class(cls):
cls.utypes = ... |
62cace37328af2d333078c0dd3af949cd8167579bd4fa29d21fe25579a7d20d1 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import math
import os
import re
import time
import pytest
import numpy as np
from numpy.testing import assert_equal
from astropy.io import fits
from astropy.io.fits.hdu.compressed import SUBTRACTIVE_DITHER_1, DITHER_SEED_CHECKSUM
from astropy.utils.excep... |
4517edfaedfcadbc40d502fa16a05db33d6a7db36d3f73bbf0e278b994502187 | import numpy as np
import pytest
from astropy.io import ascii
from astropy.io.ascii.qdp import _read_table_qdp, _write_table_qdp
from astropy.io.ascii.qdp import _get_lines_from_file
from astropy.table import Table, Column, MaskedColumn
from astropy.utils.exceptions import AstropyUserWarning
def test_get_tables_from_... |
dbe23994e9504746d39e5f3531139c8e8e38a5b6db3e2791260065775747d119 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some methods related to ``CDS`` format
reader/writer.
Requires `pyyaml <https://pyyaml.org/>`_ to be installed.
"""
import numpy as np
import pytest
from io import StringIO
from astropy.io import ascii
from astropy import units as u... |
bd88dccda7fe2df3cc56eeef4ba6f449c445b44e34179f70c2afdac86c71912d | # 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... |
ec4677bca1fc0be35ac533e8507359391dd20943cf3bff4df8a9242b154b129c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import numpy as np
import pytest
from astropy.io import ascii
from astropy.io.ascii.core import InconsistentTableError
from .common import (assert_equal, assert_almost_equal)
def assert_equal_splitlines(arg1, arg2):
assert... |
33f349902c17602fcdd4719119c902ec7a5756a30f5308c86803b0298a544a63 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import pytest
from astropy.io.ascii.ui import read
from astropy.io.ascii.ipac import Ipac, IpacFormatError, IpacFormatErrorDBMS
from astropy.io import ascii
from astropy.table import Table, Column
from astropy.io.ascii.core impor... |
d9a466545f178a9764cfed1f4481ee859e16b2fcc06adaa982a5ca26a82c9ee2 | # -*- coding: utf-8 -*-
# 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 impor... |
5820a156ebb6ddf68b0eed96e5d1e631717bf7281f5f55cdf2ed31161ac0f20b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import numpy as np
from astropy.utils.decorators import deprecated
__all__ = ['assert_equal', 'assert_almost_equal',
'assert_true', 'setup_function', 'teardown_function',
'has_isnan']
CWD = os.getcwd()
TEST_DIR = os.pat... |
5ccbe7eaa733cac7e8f0207a207376d9dd1eecfddeb5d40f33c9da706b4fc5ed | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.io.ascii import read
from astropy.utils.data import get_pkg_data_filename
# NOTE: Python can be built without bz2 or lzma
from astropy.utils.compat.optional_deps import HAS_BZ2, HAS_LZMA # noqa
@pytest.mar... |
5faade11f31845505507d86d9ccec609c28601f97c54ca1e9d50efa2af2f45dc | # 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... |
8b8a3ddcc41cca04ec79ee13828b925c9b29201728e20905d829daec3a9bbb96 | # -*- coding: utf-8 -*-
# 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, open
from collections import OrderedDict
import locale
import platform
from io import StringIO
import pathlib
import pytest
import numpy as np
from... |
b313588ce54f742f8b56c7f1f57e3acff94ba0f3fce4e0bdb606d58cbfe83496 | # 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 pytest
import numpy as np
from astropy.io import ascii
from astropy import table
from astropy.table.table_helpers import simple_table
fro... |
78bb03956d59ec4f4f00a259595429920e36c554ba92ba419dc3eb5b0c167e84 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.table import Table, Column
from astropy.table.table_helpers import simple_table
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.compat.optional_deps import HAS_BS4 # noqa
import numpy as np
files = [... |
7bba2560a7e1ba1fc2d488cbebd9e17fec9302cd19440c87e3150a2adb3c25a6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.io import ascii
from .common import (assert_equal, assert_almost_equal, # noqa
setup_function, teardown_function) # noqa
from astropy import units as u
def read_table1(readme, data):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.