hash
stringlengths
64
64
content
stringlengths
0
1.51M
4cc576c3b6f0b59674ec60d5a1d7f36e36953703a8ed743c9d36b5cfe7ddee1d
# 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 difflib import fnmatch import functools import glob import i...
e7b663c013ee5bdff8466fb9a732f32c9aaf64e210203879c4b8eaf6c8b5ae09
# Licensed under a 3-clause BSD style license - see PYFITS.rst """ A package for reading and writing FITS files and manipulating their contents. A module for reading and writing Flexible Image Transport System (FITS) files. This file format was endorsed by the International Astronomical Union in 1999 and mandated by...
77030c4bf69b9dd728d9bd2a8d894346af9c4f4f1109fa681ef924fa1f2a3188
# Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import operator import re import sys import warnings import weakref import numbers from functools import reduce from collections import OrderedDict from contextlib import suppress import numpy as np from numpy import char as chararray from ....
660fcf0c99c5fc68e2947eb08f80be105ed74fb782fd03377a578840d882a931
# Licensed under a 3-clause BSD style license - see PYFITS.rst import collections import copy import itertools import re import warnings from .card import Card, _pad, KEYWORD_LENGTH from .file import _File from .util import encode_ascii, decode_ascii, fileobj_closed, fileobj_is_binary from ...utils import isiterable...
0de99bf65ac362a12d26e7a3e7b396fa1fca37d9511c5b60410c23ce40551b7f
# 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 .column import (ASCIITNULL, FITS2NUMPY, ASCII2NUMPY, ASCII2STR, ColDefs,...
a5bcb3aa8a77a8850706e8d9d943757cdaf9d1103e07e9a1d89dab7e942cbc38
# 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 ... import units as u from ...coordinates import EarthLocation from ...table import Column from ...time import Time, TimeDelta...
f5ba2049809e4ebe76c0ad048bba0145528f72c7fa5d5a5e0a549ff88400074b
# 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 ...
b526a1e03c0ebf94c145ec1dd5ad900f469f52512be1d1cc411dea200698fa37
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os from distutils.core import Extension from glob import glob from astropy_helpers import setup_helpers from astropy_helpers.distutils_helpers import get_distutils_build_option def _get_compression_extension(): # 'numpy' will be replaced wit...
d5962d0bfcd2c2036e9f6e9bfe01195f204e7783a0aa70a83c8db123083de1f3
""" This module is for functions that do tricky things with Numpy arrays and dtypes that are not normally supported in Numpy (but can work in limited cases relevant to FITS) or that otherwise require workarounds. """ def realign_dtype(dtype, offsets): """ Given a Numpy struct dtype object an a list of integer...
ef448ddff2d4153d7713fa0e608603c7d0a9d7ee53a818017c0be75676bfcc60
# 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 ...u...
b45b4d3ed9663a31316d7c7dd252e7af09849581aabb04f14dfc81de1a27c3db
# 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 ...utils.exceptions import AstropyUserWarning __all_...
1618a7f018fa0bc666e1251dbe7be4782471eb9c2bfbaf66101d6c3d0c24c177
# Licensed under a 3-clause BSD style license - see PYFITS.rst import operator import warnings from ...utils import indent from ...utils.exceptions import AstropyUserWarning class VerifyError(Exception): """ Verify exception class. """ class VerifyWarning(AstropyUserWarning): """ Verify warnin...
8ffeb67a34cb15d1f308dc3a261ef9fed8adaa9b1b846022e84c13d6a75c61cb
# 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...
8dbf451722b8f75ddb21ee7828f214ae61b780e147f21277977a398d9f1369d2
# 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:...
1a8b94f4ec762baa15860b9b784229a3162c629c1a4bf3b0d7381f04a3426a26
# 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 import functools from .. import registry as io_registry from ...table import Table __all__ = [] # Generic # ======= def read_asciitable(filename, **kwargs): fro...
6d9ded624ba6b5fa200aa69a8e582f11ae4f9a4af3c88dd34e1b22a1662ec4c7
# 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...
b1e9db7fb9664be150399df047d6c2aaa03693c8f05c4df0afb535217f127f3f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ An extensible ASCII table reader and writer. """ from .core import (InconsistentTableError, ParameterError, NoType, StrType, NumType, FloatType, IntType, AllType, Column, Ba...
f39a23a3596a9a0e68ccde02049952186e7c623b6c5bfa9713bb0490591df0e2
# 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...
bdccb92c05c65777d9a610c8a73bbc88a176bc4c7343db8577a0bdfa0bad0339
# 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...
21f568567732446c40a6daaf53862e12031ae5ddfa0778196861d495c359915b
# 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...
715e4e0c923018c5f60f92a3e8b1830bbd8b7076e1266a47d1498186bbbc729e
# 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...
4ff19f16e0a76c0f82e192ca545ee10be27e22f72f83d3059633060fb75d1c16
# Licensed under a 3-clause BSD style license import os from distutils.extension import Extension 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( name...
c94614232640adf9b5e1a0494fe7ad8ef78a5b8ef615ad55c0e232f50ab56afb
# 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 import numpy from . import cor...
984c3e79d031960de0ee2166a7cc87b1486bbac661f9a28223dd15e8002fe421
# 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...
0e9cab86eaedb1497667001403ff0a83e85bdfef669d4145ba858e1f058c968d
# 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...
8dbea67dd1d25ea46f76ee0efc826b405cc406e8c5f82366199e1c150af3f3e8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re import copy from collections import OrderedDict from . import core from ...table import Table from . import cparser from ...utils import set_locale class FastBasic(metaclass=core.MetaBaseReader): """ This class is intended to handle t...
cc5b56b8543be01270148597f5d50fc76c24ca69b9573539a0d2ab60d7b64686
"""A Collection of useful miscellaneous functions. misc.py: Collection of useful miscellaneous functions. :Author: Hannes Breytenbach (hannes@saao.ac.za) """ import collections import itertools import operator def first_true_index(iterable, pred=None, default=None): """find the first index position for the...
d9b27d0bea3259f0c8363a8c0fb0a56ea48f50244c972e5361e639169fe17137
# 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...
bd2145e62e64021e7c5778baaa9b1f09036b80cd9881884c0df45cce7b19f712
# 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 contextlib from . import core, basic from ...
facc04648b90e6548f9f85ae6865f71bfef9a62491695b3140523317b5f0dd2d
# 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 hdf5.register_hdf5()
449c99bd91aae940461176fd46c9d5c9b8e547ce3d34815ec1ad3c41d103fa31
# 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:`table_io` for more details. """ import os import warnings import nu...
c1f72d23fe909fbfa6d72701788d7b2e5b26c252d2a6d4bd5384971066fb5e45
# 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...
088e13cbde682ab75c99bc9b3ef5e4da1ccc3a191497002a7042660286cbd03d
# 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 warnings from ...utils.exceptions import AstropyDeprecationWarning, NoValue __all__ = ['fnpickle', 'fnunpickle'] def fnun...
77e086eaf4a89c8edf1f96d03e97473338cf7aa13d5285317bef7a1ec8025cd2
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from copy import copy from io import StringIO import pytest import numpy as np from ..registry import _readers, _writers, _identifiers from .. import registry as io_registry from ...table import Table _READERS_ORIGINAL = copy(_readers) _WRI...
c3ee1ac6a28e719a5dd82b0d3631906a5ea1880784ead5ab383aadcc6818adbd
# 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 ...
d27395af69224627f5e645156a03b53c07087c9d8c5af210215770f8b4f9e56f
# 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 .. import registry as io_registry from ...table import Table from ...table.column import BaseColumn from ...units import Quantity def is_votable(origin, fi...
f36676c04c08c9d9ffa271f675190ce95d71ab5bddad9d15a5de10854ec2cba4
# Licensed under a 3-clause BSD style license - see LICENSE.rst # TODO: Test FITS parsing # STDLIB import io import re import sys import gzip import base64 import codecs import urllib.request import warnings # THIRD-PARTY import numpy as np from numpy import ma # LOCAL from .. import fits from ... import __version__...
2aa2ddb8a0dcd004bfc927cbb058757e7b2be915185a1e7f403171c1a9b8ae3d
# 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 ...utils.xml import iterparser from...
ea272a94ac9381acaf74d7262d7e8d2eedb17f100eae6c7c5c48707603514ec9
# 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...
aa7c71db116f415401efb81ceb95eb0b2186c674b8bb2f213eaf99a5f4a6b249
# 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...
2e5f3605f11b602b4279d0a0ada6a48eff4833cc78112050a97cb6000dd94cd3
# 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 ...utils import data __all__ = ['parse_ucd', 'check_ucd'] class UCDWords: """ Manages a list of acceptable UCD words. Works by ...
50f1a9a4f6804d57a11ba203602a49990c918f6bf0f14c05ef4d9885a88a2527
# Licensed under a 3-clause BSD style license - see LICENSE.rst from distutils.core 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")], ...
f65abf26743becc6a06b4b9efe3f59b28eac5891db861d6569e1fb886df587ff
# 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 distutils import version __all__ = [ 'convert_to_writable_filelike', 'stc_reference_frames', 'coerce_range_li...
59a06b68d217ea62af5ffeb1129761d4942403a441bf88d32aa8e67b488da767
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Various XML-related utilities """ # ASTROPY from ...logger import log from ...utils import data from ...utils.xml import check as xml_check from ...utils.xml import validate # LOCAL from .exceptions import (warn_or_raise, vo_warn, W02, W03, W04, W05...
0483fc3144978bb0c128368212a642fead91345185a69ed20e5fdb90cb8e5dfe
# 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...
7e5d474b36ec63d34f2df7ed7e77d71286fedfa9a723a283d41b8105a8ca713f
# 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...
2a982a68d7d1406ebb4ca714a5f5f88947b093e32666199bc02d0ca75be7d281
# 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...
5e90853120b0d0b6440b8f24648bf398d2cefe5552d8f063ccb93e262def0a60
# Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import logging import optparse import os import sys import textwrap import warnings from ... import fits from ..util import fill from ....utils.exceptions import AstropyDeprecationWarning log = logging.getLogger('fitsdiff') USAGE = """ Com...
245a6c95e3e4d932ce501dece403715b72d4ff81a5f4cbc90954b67e246d2f6d
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import numpy as np from .base import DTYPE2BITPIX from .image import PrimaryHDU from .table import _TableLikeHDU from ..column import Column, ColDefs, FITS2NUMPY from ..fitsrec import FITS_rec, FITS_record from ..util import _is_int, _is_pseudo...
1dc3797b9236521475ce07edb57be136b335996c0c2a51f1e16327a0c1a3a08d
# 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 ...
a28b000f60b0aac57dd77d18dbc67f9826f855625d0c3c3fbf9672b00440bf89
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import io from ..file import _File from .base import NonstandardExtHDU from .hdulist import HDUList from ..header import Header, _pad_length from ..util import fileobj_name from ....utils import lazyproperty class FitsHDU(NonstandardExtHDU)...
cb07c3eb8a3056cf9b1622fb101576f562f36829ca765db384cdee2358a8c400
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import warnings import numpy as np from .base import DELAYED, _ValidHDU, ExtensionHDU, BITPIX2DTYPE, DTYPE2BITPIX from ..header import Header from ..util import _is_pseudo_unsigned, _unsigned_zero, _is_int from ..verify import VerifyWarning f...
44c4a18bf034475139abb7440260bdc63ad57a10682336189740c0da6696d8c6
# 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...
fd9e7c60a107f8368412df8d408551cbe1a9f0c14b23da23dd6952fe1f315d67
# 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 .. import conf from ..file import _File from ..header import Header, _pad_length from ..util import (_...
f8f51f64a4d376320d0d35ad9222abdabbe007b724666e4b98c6f2779e7f8e1e
# Licensed under a 3-clause BSD style license - see PYFITS.rst import bz2 import gzip import itertools import os 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 ...
7198b572dc185326a40a13f6ed5671a8335eb4d1f3ebb4928bf05629158a5b5b
# 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 ..file import _File from ..header import _pad_length from ..util import fileobj_name class StreamingHDU: """ A class...
0dd3dacd795ae65492dfbaf187a3f9375588dc97e03ec2492246ce9d2edf1c09
# Licensed under a 3-clause BSD style license - see PYFITS.rst import contextlib import copy import gc import pickle import re import pytest import numpy as np from numpy import char as chararray try: import objgraph HAVE_OBJGRAPH = True except ImportError: HAVE_OBJGRAPH = False from ....io import fits ...
c5b156b1b274f136089770048bed561ef9b5a9e895969b4035f426fd0bb5c609
# 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 ..hdu.base import _ValidHDU from ....io import fits from . import FitsTestCase class TestChecksumFunctions(FitsTestCase): # All checksums have...
2654b4274e02d52936c0b086c7b9a65b4669524812ead5b3f37ea1ce717167cf
# Licensed under a 3-clause BSD style license - see PYFITS.rst import numpy as np from ....io import fits from . import FitsTestCase from ....tests.helper import catch_warnings class TestDivisionFunctions(FitsTestCase): """Test code units that rely on correct integer division.""" def test_rec_from_string(s...
1aaa163cba9568099ba12e7400456c618d6621f83f7d73ee5a0285cc09d30b6f
# 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 ....io import fits class TestGroupsFunctions(FitsTestCase): def test_open(self): with fits.open(self.data('random...
f4e82591e73c034b2e816a4fb71c2478a58fff5cbcc875a7dd516c22576cd22e
# Licensed under a 3-clause BSD style license - see PYFITS.rst import numpy as np from ....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 the ...
14ba701534932c1624c3d589625a35bb7980cba886caac5d356ce27cfb873e95
# Licensed under a 3-clause BSD style license - see PYFITS.rst import glob import io import os import platform import sys import pytest import numpy as np from ..verify import VerifyError from ....io import fits from ....tests.helper import raises, catch_warnings, ignore_warnings from ....utils.exceptions import Ast...
430a8b6e68acd1f15fb7fcb832cfa9374b792f0d6bd3837a43228a59036bfc10
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from . import FitsTestCase from ..scripts import fitscheck from ... import fits class TestFitscheck(FitsTestCase): def test_noargs(self): with pytest.raises(SystemExit) as e: fitscheck.main(['-h']) assert e....
4fcee229629f1cb15bbacbf82dce0fc75defa080b86126f6bfd5a92d609d8d2b
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os import shutil import stat import tempfile import time from ... import fits class FitsTestCase: def setup(self): self.data_dir = os.path.join(os.path.dirname(__file__), 'data') self.temp_dir = tempfile.mkdtemp(prefix='fits-t...
a9f4a5d0d88b6e6a311858579684cb2135c410af8bce79b65a7e0ed9243a7c73
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os import warnings import pytest import numpy as np from ....io import fits from ....table import Table from .. import printdiff from ....tests.helper import catch_warnings from . import FitsTestCase class TestConvenience(FitsTestCase): d...
7c6dea44608631694e159d0ae81c8a7619b811516ead69d73a68921727f31377
# 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 try: from PIL import Image HAS_PIL = True except ImportError: HAS_PIL = False from ....tests.helper import catch_warnings from .. i...
77e0fcb21f5431418f6a4fbfc4d92131235718729df5f9d3a631a2ce243d1db0
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import pytest import numpy as np from ..column import Column from ..diff import (FITSDiff, HeaderDiff, ImageDataDiff, TableDataDiff, HDUDiff, report_diff_values) from ..hdu import HDUList, PrimaryHDU, ImageHDU from ..hdu.ta...
c829afa4fdbb548e12b7f8ef27683e5a4a22c01fbf27aa7ad1fde244be4e1e91
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import warnings import collections from io import StringIO, BytesIO import pytest import numpy as np from ....io import fits from ....io.fits.verify import VerifyWarning from ....tests.helper import catch_warnings, ig...
3d5f7c090a12b3c06e0ee4ed9a3076ae0d6856ef8bd9a417a6e89c5873ec0d9e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest import os from . import FitsTestCase from ..convenience import writeto from ..hdu import PrimaryHDU, hdulist from ..scripts import fitsdiff from ....tests.helper import catch_warnings from ....utils.exceptions import Astr...
41a76640e92811434c37e8a0813f2a5e764414f6b96fe5665d2cbff176032f13
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import numpy as np from ....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 = arr1in.v...
cecf7dad8290fb773cc217661e5ccb9b55c58bdd94a4c94856b2c1e0905aa37a
# Licensed under a 3-clause BSD style license - see PYFITS.rst import pytest import numpy as np from ....io import fits from ..compression import compress_hdu from . import FitsTestCase MAX_INT = np.iinfo(np.intc).max MAX_LONG = np.iinfo(np.long).max MAX_LONGLONG = np.iinfo(np.longlong).max class TestCompression...
4f46b188f4a96a9a67cc64681f8557fa3544d9040be81d219e448f3cddee9ff4
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from . import FitsTestCase from ..scripts import fitsheader class TestFITSheader_script(FitsTestCase): def test_noargs(self): with pytest.raises(SystemExit) as e: fitsheader.main(['-h']) assert e.value.cod...
57efe26b033b908e3745460dc3c2d8cae64353d15f2fc660e66cb31351145f00
import os import gc import pathlib import warnings import pytest import numpy as np from numpy.testing import assert_allclose from .. import HDUList, PrimaryHDU, BinTableHDU from ... import fits from .... import units as u from ....table import Table, QTable, NdarrayMixin, Column from ....tests.helper import catch_...
b1f67aff2dbf6feaa64d6bdf39538bed72c401b28ec6095a5d1611e8600a177f
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import bz2 import io import mmap import os import pathlib import warnings import zipfile import pytest import numpy as np from . import FitsTestCase from ..convenience import _getext from ..diff import FITSDiff from ..file import _File, GZIP...
b3e3fa304cdd502cb4a664cdef3b3b92ba9b317c66d0e28c301d10e21fefd737
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import pytest import numpy as np from . import FitsTestCase from ..fitstime import GLOBAL_TIME_INFO, time_to_fits, is_time_column_keyword from ....coordinates import EarthLocation from ....io import fits from ....table import Table, QTable fro...
8cefbd8de1325413acfc639a840242b43ab1a097d041ed3ecfcda0cb1b242058
# Licensed under a 3-clause BSD style license - see LICENSE.rst from . import FitsTestCase from ..scripts import fitsinfo class TestFitsinfo(FitsTestCase): def test_onefile(self, capsys): fitsinfo.main([self.data('arange.fits')]) out, err = capsys.readouterr() out = out.splitlines() ...
be4c6f485ae5b1e604da8a240eee912e2f9652566a5271e0e599c2a087dfbb83
# Licensed under a 3-clause BSD style license - see PYFITS.rst import platform import pytest import numpy as np from ....io import fits from . import FitsTestCase from ....tests.helper import ignore_warnings class TestUintFunctions(FitsTestCase): @classmethod def setup_class(cls): cls.utypes = ('u2...
6ddf130ee3a0d62ead35af111ecfcfa1e661c943c5d5543fe584a0cf50490b8d
# Licensed under a 3-clause BSD style license - see PYFITS.rst import math import os import platform import re import time import warnings import pytest import numpy as np from numpy.testing import assert_equal from ....io import fits from ....utils.exceptions import AstropyPendingDeprecationWarning from ....utils....
11163864cb3fb5eff0b22398e556e429e86cf7a5284b16fb047bc8e445f5074d
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import functools from io import BytesIO from textwrap import dedent import pytest import numpy as np from numpy import ma from ....table import Table, MaskedColumn from ... import ascii from ...ascii.core import ParameterError, FastOptionsErr...
855fc3cd24d3ff5093b9ae6d236ed34236c0706129fc35cebba6f5695fc057cc
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import pytest from ... import ascii from ..core import InconsistentTableError from .common import (assert_equal, assert_almost_equal) def assert_equal_splitlines(arg1, arg2): assert_equal(arg1.splitlines(), arg2.splitlines...
2b9d05b459d10b68d4662bc1851c375195c03ca06a87adaf46130feb8f41b1d0
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import pytest from ..ui import read from ..ipac import Ipac, IpacFormatError, IpacFormatErrorDBMS from ....tests.helper import catch_warnings from ... import ascii from ....table import Table from ..core import masked DATA = '...
e4c25b78fdd3e47f88b9404ce90b82cc09c13b2ee7d7afff55af89a32f4dc99f
# -*- 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...
1c5c4c6c061b09a6bf962ca1e4f2afdb3fefbcf95b5d4202fc2fb9f4b005a022
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import numpy as np __all__ = ['raises', 'assert_equal', 'assert_almost_equal', 'assert_true', 'setup_function', 'teardown_function', 'has_isnan'] CWD = os.getcwd() TEST_DIR = os.path.dirname(__file__) has_isnan = Tru...
6c6e1e67ca760e48dd5868e03d8d1548fbac210d54605724b4201d3db41c41e4
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys import pytest import numpy as np from .. import read ROOT = os.path.abspath(os.path.dirname(__file__)) try: import bz2 # pylint: disable=W0611 except ImportError: HAS_BZ2 = False else: HAS_BZ2 = True try: import ...
f7d9e98c4b7e9a6f033319d64a40160fa9bf838935681a986bfcb554c0538fb4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some of the methods related to the ``ECSV`` reader/writer. Requires `pyyaml <http://pyyaml.org/>`_ to be installed. """ import os import copy import sys from io import StringIO import pytest import numpy as np from ....table impor...
48fe6f2333df076a5e934723c879c27da9fb8c2bb2e330fb6aa034f8c7c7e4ac
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst 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 ... import ascii from ....table import Table f...
10f4cf70ac2e768243da06950e6d15d002194a5d240f81e5572c3ad6d1009db5
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import copy from io import StringIO from itertools import chain import pytest import numpy as np from ... import ascii from .... import table from ....table.table_helpers import simple_table from ....tests.helper import catch_warnings from ....
4a5072167df1f060e245a1f7091a1ba4dd8a360553bb736210a848e5f4d63976
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import pytest from ....table import Table, Column from ....table.table_helpers import simple_table import numpy as np ROOT = os.path.abspath(os.path.dirname(__file__)) files = ['t/cds.dat', 't/ipac.dat', 't/daophot.dat', 't/latex1.tex', ...
08d70fbdc775e15d2c4b7e2960052db27a27ff3ed1480283c3e2f5c7e0e429d0
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ... import ascii from .common import (assert_equal, assert_almost_equal, has_isnan, setup_function, teardown_function) def read_table1(readme, data): reader = ascii.Cds(readme) return reader.read(data) def read_table2...
4e472c887799a2e7adce28ebff1ec83de8977725f18a1711be0a885293b0858f
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO from ... import ascii from .common import (assert_equal, assert_almost_equal) def assert_equal_splitlines(arg1, arg2): assert_equal(arg1.splitlines(), arg2.splitlines()) def test_read_normal(): """Normal SimpleRST Tabl...
f68c10024f8867bfc5d7d19534a598a72e24344d0bcce26354b0bff1637511af
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import numpy as np from ... import ascii from .common import assert_equal def test_types_from_dat(): converters = {'a': [ascii.convert_numpy(float)], 'e': [ascii.convert_numpy(str)]} dat = ascii.rea...
415ab866c2c63f471837194e1b7a71fdd13af70a96a709faa532601de76255c1
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ The **asdf** subpackage contains code that is used to serialize astropy types so that they can be represented and stored using the Advanced Scientific Data Format (ASDF). This subpackage defines classes, referred to as **tags**,...
16092d85ddbcfeb7014c00eb9f5b8c98b7399b257f55cb5dede401cbdfd33605
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import six from asdf.asdftypes import CustomType, ExtensionTypeMeta __all__ = ['AstropyType', 'AstropyAsdfType'] _astropy_types = set() _astropy_asdf_types = set() class AstropyTypeMeta(ExtensionTypeMeta): """ Keeps ...
06a9191a0649d330501f9fb95954919253bf1dafd569c188dc49e1d2446726f8
# Licensed under a 3-clause BSD style license import os def get_package_data(): # Installs the schema files schemas = [] root = os.path.join(os.path.dirname(__file__), 'schemas') for node, dirs, files in os.walk(root): for fname in files: if fname.endswith('.yaml'): ...
87d347247b7412c36d95007370f29350ab488c0e2d319b464ee48fed9f1e2eb5
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import os from asdf.extension import AsdfExtension, BuiltinExtension from asdf.resolver import Resolver, DEFAULT_URL_MAPPING from asdf.util import filepath_to_url # Make sure that all tag implementations are imported by the time ...
8cefef05a2074a686a99a409f7a37bbe48bafa4d7f6236bfc5972d83e662f354
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some of the methods related to YAML serialization. Requires `pyyaml <http://pyyaml.org/>`_ to be installed. """ from io import StringIO import pytest import numpy as np from ....coordinates import SkyCoord, EarthLocation, Angle, ...
3c203b64e68b845006c21965994ad1025dd5acfce9efb5c9ca7b9a95f0af570d
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from ....tests.helper import catch_warnings from ....table import Table, QTable, NdarrayMixin, Column from .... import units as u from ....coordinates import SkyCoord, Latitude, Longitude, Angle, EarthLocation from ......
c5590daa0dbae6e598534376e2001eee076428a188ddc9eabdd0c430fbae9526
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from .. import fnpickle, fnunpickle from ....tests.helper import catch_warnings from ....utils.exceptions import AstropyDeprecationWarning def test_fnpickling_simple(tmpdir): """ Tests the `fnpickle` and `fnupickle` functions' bas...
c999981ea65284641b7af7a3197f91d97659a006ded67971f520150b9fe7e938
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import numpy as np from asdf import yamlutil from asdf.tags.core.ndarray import NDArrayType from astropy import table from ...types import AstropyAsdfType class TableType(AstropyAsdfType): name = 'core/table' types = ['a...
2c0bd4d5d71b34162225974cb40dda7404b1faedfcc1b7866f0099fd450f0b67
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- def get_package_data(): # pragma: no cover return { str('astropy.io.misc.asdf.tags.fits.tests'): ['data/*.fits'] }